make groups from selection
[jalview.git] / src / jalview / appletgui / AlignViewport.java
index 8e80376..1b3af30 100755 (executable)
@@ -1167,7 +1167,25 @@ 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
+   */
+  public SequenceI[] getSequenceSelection()
+  {
+    SequenceI[] sequences=null;
+    if (selectionGroup!=null)
+    {
+      sequences = selectionGroup.getSequencesInOrder(alignment);
+    }
+    if (sequences == null)
+    {
+      sequences = alignment.getSequencesArray();
+    }
+    return sequences;
+  }
   /**
    * This method returns the visible alignment as text, as seen on the GUI, ie
    * if columns are hidden they will not be returned in the result. Use this for