+ fixedRight = fixedLeft - 1;\r
+ fixedLeft = 0;\r
+ }\r
+ else if (fixedRight < startres)\r
+ {\r
+ fixedLeft = fixedRight;\r
+ fixedRight = -1;\r
+ }\r
+ }\r
+\r
+\r
+\r
+ if(av.hasHiddenColumns)\r
+ {\r
+ fixedColumns = true;\r
+ int y1 = av.getColumnSelection().getHiddenBoundaryLeft(startres);\r
+ int y2 = av.getColumnSelection().getHiddenBoundaryRight(startres);\r
+\r
+ if( ( insertGap && startres>y1 && lastres<y1)\r
+ || (!insertGap && startres<y2 && lastres>y2) )\r
+ {\r
+ endEditing();\r
+ return;\r
+ }\r
+\r
+ if(fixedRight<y2 && fixedRight==-1 && y2!=startres)\r
+ fixedRight = y2 -1;\r
+ if(y1>fixedLeft && fixedLeft==-1)\r
+ fixedLeft = y1;\r
+ }\r
+\r
+ if (groupEditing)\r
+ {\r
+\r
+ /*if (av.hasHiddenRows)\r
+ {\r
+ //sg might be null as the user may only see 1 sequence\r
+ if (sg == null)\r
+ {\r
+ sg = new SequenceGroup();\r
+ sg.addSequence(av.alignment.getSequenceAt(startseq), false);\r
+ }\r
+\r
+ SequenceGroup tmp = new SequenceGroup();\r
+\r
+ //Do any of the sequences have hidden associates?\r
+ for (int s = 0; s < sg.getSize(); s++)\r
+ {\r
+ seq = sg.getSequenceAt(s);\r
+ tmp.addSequence(seq, false);\r
+ if (seq.getHiddenSequences() != null)\r
+ {\r
+ for (int h = 0; h < seq.getHiddenSequences().getSize(); h++)\r
+ tmp.addSequence(seq.getHiddenSequences().getSequenceAt(h),\r
+ false);\r
+ }\r
+ }\r
+\r
+ sg = tmp;\r
+ }*/\r
+ // int blankColumn = -1;\r
+\r
+\r
+ // drag to right\r
+ if (insertGap)\r
+ {\r
+ //If the user has selected the whole sequence, and is dragging to\r
+ // the right, we can still extend the alignment and selectionGroup\r
+ if(sg.getStartRes() == 0 && sg.getEndRes() + 1 == av.alignment.getWidth())\r
+ {\r
+ sg.setEndRes(av.alignment.getWidth() + startres - lastres);\r
+ fixedRight = sg.getEndRes();\r
+ }\r
+\r
+ // Is it valid with fixed columns??\r
+ // Find the next gap before the end\r
+ // of the visible region boundary\r
+ boolean blank = false;\r
+ for (fixedRight = fixedRight;\r
+ fixedRight > lastres;\r
+ fixedRight--)\r