* @param start beginning of edit\r
* @param left shift in edit (+ve for removal, or -ve for inserts)\r
*/\r
- public void compensateForEdit(int start, int change)\r
+ public Vector compensateForEdit(int start, int change)\r
{\r
+ Vector deletedHiddenColumns = null;\r
for (int i = 0; i < size(); i++)\r
{\r
int temp = columnAt(i);\r
\r
if(hiddenColumns!=null)\r
{\r
- for(int i=0; i<hiddenColumns.size(); i++)\r
+ deletedHiddenColumns = new Vector();\r
+ int hSize = hiddenColumns.size();\r
+ for(int i=0; i<hSize; i++)\r
{\r
int[] region = (int[]) hiddenColumns.elementAt(i);\r
- if(region[0] > start)\r
+ if ( region[0]>start && start+change>region[1] )\r
+ {\r
+ deletedHiddenColumns.addElement(\r
+ hiddenColumns.elementAt(i));\r
+\r
+ hiddenColumns.removeElementAt(i);\r
+ i--;\r
+ hSize--;\r
+ continue;\r
+ }\r
+\r
+ if(region[0]>start)\r
{\r
region[0] -= change;\r
region[1] -= change;\r
}\r
+\r
if(region[0]<0)\r
region[0] = 0;\r
- if(region[1] <0)\r
- region[1] = 0;\r
+\r
}\r
+\r
+ this.revealHiddenColumns(0);\r
}\r
+\r
+ return deletedHiddenColumns;\r
}\r
/**\r
* propagate shift in alignment columns to column selection\r