added feature gradient colours and sortby feature score/density to feature settings...
[jalview.git] / src / jalview / gui / AlignViewport.java
index 0536f8d..19ec9e0 100755 (executable)
@@ -184,6 +184,8 @@ public class AlignViewport implements SelectionSource
 
   Hashtable hiddenRepSequences;
 
+  boolean sortByTree;
+
   /**
    * Creates a new AlignViewport object.
    * 
@@ -373,13 +375,15 @@ public class AlignViewport implements SelectionSource
     }
 
     wrapAlignment = jalview.bin.Cache.getDefault("WRAP_ALIGNMENT", false);
+    showUnconserved = jalview.bin.Cache.getDefault("SHOW_UNCONSERVED", false);
+    sortByTree = jalview.bin.Cache.getDefault("SORT_BY_TREE", false);
   }
 
   /**
-   * DOCUMENT ME!
+   * set the flag
    * 
    * @param b
-   *                DOCUMENT ME!
+   *             features are displayed if true
    */
   public void setShowSequenceFeatures(boolean b)
   {
@@ -1624,14 +1628,14 @@ public class AlignViewport implements SelectionSource
    */
   public SequenceI[] getSequenceSelection()
   {
-    SequenceI[] sequences;
-    if (selectionGroup == null)
+    SequenceI[] sequences=null;
+    if (selectionGroup!=null)
     {
-      sequences = alignment.getSequencesArray();
+      sequences = selectionGroup.getSequencesInOrder(alignment);
     }
-    else
+    if (sequences == null)
     {
-      sequences = selectionGroup.getSequencesInOrder(alignment);
+      sequences = alignment.getSequencesArray();
     }
     return sequences;
   }
@@ -2197,5 +2201,39 @@ public class AlignViewport implements SelectionSource
   {
     return showSeqFeaturesHeight; 
   }
-
+  boolean showUnconserved=false;
+  public boolean getShowUnconserved()
+  {
+    return showUnconserved;
+  }
+  public void setShowUnconserved(boolean showunconserved)
+  {
+    showUnconserved=showunconserved;
+  }
+  /**
+   * return the alignPanel containing the given viewport. Use this to get the
+   * components currently handling the given viewport.
+   * @param av
+   * @return null or an alignPanel guaranteed to have non-null alignFrame reference
+   */
+  public AlignmentPanel getAlignPanel()
+  {
+    AlignmentPanel[] aps = PaintRefresher.getAssociatedPanels(this.getSequenceSetId());
+    AlignmentPanel ap=null;
+    for (int p=0;aps!=null && p<aps.length; p++)
+    {
+      if (aps[p].av == this)
+      {
+        return aps[p];
+      }
+    }
+    return null;
+  }
+  public boolean getSortByTree()
+  {
+    return sortByTree;
+  }
+  public void setSortByTree(boolean sort) {
+    sortByTree = sort;
+  }
 }