refactored invertColumnSelection as an object method
[jalview.git] / src / jalview / gui / AlignViewport.java
index 41341d0..afdfd69 100755 (executable)
@@ -1453,20 +1453,7 @@ public class AlignViewport
 
     public void invertColumnSelection()
     {
-      for(int i=0; i<alignment.getWidth(); i++)
-      {
-        if(colSel.contains(i))
-      {
-          colSel.removeElement(i);
-      }
-        else
-        {
-          if (!hasHiddenColumns || colSel.isVisible(i))
-          {
-            colSel.addElement(i);
-          }
-        }
-      }
+      colSel.invertColumnSelection(0,alignment.getWidth());
     }
 
     public int adjustForHiddenSeqs(int alignmentIndex)
@@ -1479,7 +1466,7 @@ public class AlignViewport
      * derived from the whole alignment or just the current
      * selection with start and end points adjusted
      * @note if you need references to the actual SequenceI objects in the alignment or currently selected then use getSequenceSelection()
-     * @return String[]
+     * @return selection as new sequenceI objects
      */
     public SequenceI[] getSelectionAsNewSequence()
     {
@@ -1501,6 +1488,7 @@ public class AlignViewport
 
       return sequences;
     }
+    
     /**
      * get the currently selected sequence objects or all the sequences in the alignment.
      * @return array of references to sequence objects