JAL-1553 enhancement of column selection by annotation row to include the query filte...
[jalview.git] / src / jalview / gui / AlignViewport.java
index 5c383d8..b8f575f 100644 (file)
@@ -42,9 +42,8 @@ import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.analysis.NJTree;
 import jalview.api.AlignViewportI;
 import jalview.bin.Cache;
-import jalview.datamodel.AlignmentAnnotation;
+import jalview.commands.CommandI;
 import jalview.datamodel.AlignmentI;
-import jalview.datamodel.Annotation;
 import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
@@ -96,10 +95,6 @@ public class AlignViewport extends AlignmentViewport implements
 
   boolean renderGaps = true;
 
-  boolean showSequenceFeatures = false;
-
-  boolean showAnnotation = true;
-
   SequenceAnnotationOrder sortAnnotationsBy = null;
 
   int charHeight;
@@ -126,12 +121,6 @@ public class AlignViewport extends AlignmentViewport implements
 
   boolean cursorMode = false;
 
-  /**
-   * Keys are the feature types which are currently visible. Note: Values are
-   * not used!
-   */
-  Hashtable featuresDisplayed = null;
-
   boolean antiAlias = false;
 
   Rectangle explodedPosition;
@@ -140,18 +129,18 @@ public class AlignViewport extends AlignmentViewport implements
 
   boolean gatherViewsHere = false;
 
-  Stack historyList = new Stack();
+  Stack<CommandI> historyList = new Stack<CommandI>();
 
-  Stack redoList = new Stack();
+  Stack<CommandI> redoList = new Stack<CommandI>();
 
   int thresholdTextColour = 0;
 
   Color textColour = Color.black;
 
   Color textColour2 = Color.white;
+  private boolean rightAlignIds = false;
 
-  boolean rightAlignIds = false;
-
+  private AnnotationColumnChooser annotationColumnSelectionState;
   /**
    * Creates a new AlignViewport object.
    * 
@@ -287,9 +276,9 @@ public class AlignViewport extends AlignmentViewport implements
     antiAlias = Cache.getDefault("ANTI_ALIAS", false);
 
     showJVSuffix = Cache.getDefault("SHOW_JVSUFFIX", true);
-    showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true);
+    setShowAnnotation(Cache.getDefault("SHOW_ANNOTATIONS", true));
 
-    rightAlignIds = Cache.getDefault("RIGHT_ALIGN_IDS", false);
+    setRightAlignIds(Cache.getDefault("RIGHT_ALIGN_IDS", false));
     centreColumnLabels = Cache.getDefault("CENTRE_COLUMN_LABELS", false);
     autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
 
@@ -337,10 +326,6 @@ public class AlignViewport extends AlignmentViewport implements
               false);
       showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
       showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
-      consensus = new AlignmentAnnotation("Consensus", "PID",
-              new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-      consensus.hasText = true;
-      consensus.autoCalculated = true;
     }
     initAutoAnnotation();
     if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
@@ -373,22 +358,6 @@ public class AlignViewport extends AlignmentViewport implements
   }
 
   /**
-   * set the flag
-   * 
-   * @param b
-   *          features are displayed if true
-   */
-  public void setShowSequenceFeatures(boolean b)
-  {
-    showSequenceFeatures = b;
-  }
-
-  public boolean getShowSequenceFeatures()
-  {
-    return showSequenceFeatures;
-  }
-
-  /**
    * centre columnar annotation labels in displayed alignment annotation TODO:
    * add to jalviewXML and annotation display settings
    */
@@ -842,27 +811,6 @@ public class AlignViewport extends AlignmentViewport implements
    * 
    * @return DOCUMENT ME!
    */
-  public boolean getShowAnnotation()
-  {
-    return showAnnotation;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param b
-   *          DOCUMENT ME!
-   */
-  public void setShowAnnotation(boolean b)
-  {
-    showAnnotation = b;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   */
   public boolean getScaleAboveWrapped()
   {
     return scaleAboveWrapped;
@@ -1106,8 +1054,6 @@ public class AlignViewport extends AlignmentViewport implements
     return followSelection;
   }
 
-  boolean showSeqFeaturesHeight;
-
   public void sendSelection()
   {
     jalview.structure.StructureSelectionManager
@@ -1116,16 +1062,6 @@ public class AlignViewport extends AlignmentViewport implements
                     new ColumnSelection(getColumnSelection()), this);
   }
 
-  public void setShowSequenceFeaturesHeight(boolean selected)
-  {
-    showSeqFeaturesHeight = selected;
-  }
-
-  public boolean getShowSequenceFeaturesHeight()
-  {
-    return showSeqFeaturesHeight;
-  }
-
   /**
    * return the alignPanel containing the given viewport. Use this to get the
    * components currently handling the given viewport.
@@ -1298,4 +1234,31 @@ public class AlignViewport extends AlignmentViewport implements
   {
     this.showAutocalculatedAbove = showAutocalculatedAbove;
   }
+
+
+  public boolean isShowAnnotation()
+  {
+    return super.isShowAnnotation();
+  }
+
+  public boolean isRightAlignIds()
+  {
+    return rightAlignIds;
+  }
+
+  public void setRightAlignIds(boolean rightAlignIds)
+  {
+    this.rightAlignIds = rightAlignIds;
+  }
+
+  public AnnotationColumnChooser getAnnotationColumnSelectionState()
+  {
+    return annotationColumnSelectionState;
+  }
+
+  public void setAnnotationColumnSelectionState(
+          AnnotationColumnChooser currentAnnotationColumnSelectionState)
+  {
+    this.annotationColumnSelectionState = currentAnnotationColumnSelectionState;
+  }
 }