endRes = end;\r
}\r
\r
+ public boolean adjustForRemoveLeft(int col)\r
+ {\r
+ // return value is true if the group still exists\r
+ if(startRes>=col)\r
+ startRes = startRes - col;\r
+ if(endRes>=col)\r
+ {\r
+ endRes = endRes - col;\r
+ if(startRes>endRes)\r
+ startRes = 0;\r
+ }\r
+ else\r
+ {\r
+ // must delete this group!!\r
+ return false;\r
+ }\r
+\r
+ return true;\r
+ }\r
+\r
+ public boolean adjustForRemoveRight(int col)\r
+ {\r
+\r
+ if(startRes>col)\r
+ {\r
+ // delete this group\r
+ return false;\r
+ }\r
+\r
+ if(endRes>=col)\r
+ endRes = col;\r
+\r
+\r
+ return true;\r
+ }\r
+\r
+\r
public String getName()\r
{\r
return groupName;\r
int min = colSel.getMin();\r
viewport.getAlignment().trimLeft(min);\r
colSel.compensateForEdit(0,min);\r
+\r
+ if(viewport.getSelectionGroup()!=null)\r
+ viewport.getSelectionGroup().adjustForRemoveLeft(min);\r
+\r
+ Vector groups = viewport.alignment.getGroups();\r
+ for(int i=0; i<groups.size(); i++)\r
+ {\r
+ SequenceGroup sg = (SequenceGroup) groups.get(i);\r
+ if(!sg.adjustForRemoveLeft(min))\r
+ viewport.alignment.deleteGroup(sg);\r
+ }\r
+\r
alignPanel.RefreshPanels();\r
}\r
}\r
if (colSel.size() > 0)\r
{\r
int max = colSel.getMax();\r
- if(max>1)\r
- viewport.getAlignment().trimRight(max);\r
+ viewport.getAlignment().trimRight(max);\r
+ if(viewport.getSelectionGroup()!=null)\r
+ viewport.getSelectionGroup().adjustForRemoveRight(max);\r
+\r
+ Vector groups = viewport.alignment.getGroups();\r
+ for(int i=0; i<groups.size(); i++)\r
+ {\r
+ SequenceGroup sg = (SequenceGroup) groups.get(i);\r
+ if(!sg.adjustForRemoveRight(max))\r
+ viewport.alignment.deleteGroup(sg);\r
+ }\r
+\r
+\r
\r
alignPanel.RefreshPanels();\r
}\r