JAL-1683 replace year/version strings with tokens in source
[jalview.git] / src / jalview / gui / AlignViewport.java
index d6df385..b088e08 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -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,8 +95,6 @@ public class AlignViewport extends AlignmentViewport implements
 
   boolean renderGaps = true;
 
-  boolean showAnnotation = true;
-
   SequenceAnnotationOrder sortAnnotationsBy = null;
 
   int charHeight;
@@ -132,9 +129,9 @@ 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;
 
@@ -142,8 +139,7 @@ public class AlignViewport extends AlignmentViewport implements
 
   Color textColour2 = Color.white;
 
-  boolean rightAlignIds = false;
-
+  private AnnotationColumnChooser annotationColumnSelectionState;
   /**
    * Creates a new AlignViewport object.
    * 
@@ -199,16 +195,7 @@ public class AlignViewport extends AlignmentViewport implements
     setAlignment(al);
     if (hiddenColumns != null)
     {
-      this.colSel = hiddenColumns;
-      if (hiddenColumns.getHiddenColumns() != null
-              && hiddenColumns.getHiddenColumns().size() > 0)
-      {
-        hasHiddenColumns = true;
-      }
-      else
-      {
-        hasHiddenColumns = false;
-      }
+      colSel = hiddenColumns;
     }
     init();
   }
@@ -255,16 +242,7 @@ public class AlignViewport extends AlignmentViewport implements
     setAlignment(al);
     if (hiddenColumns != null)
     {
-      this.colSel = hiddenColumns;
-      if (hiddenColumns.getHiddenColumns() != null
-              && hiddenColumns.getHiddenColumns().size() > 0)
-      {
-        hasHiddenColumns = true;
-      }
-      else
-      {
-        hasHiddenColumns = false;
-      }
+      colSel = hiddenColumns;
     }
     init();
   }
@@ -279,9 +257,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);
 
@@ -329,10 +307,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)
@@ -818,27 +792,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;
@@ -1038,23 +991,6 @@ public class AlignViewport extends AlignmentViewport implements
     shownpfeats = show;
   }
 
-  /**
-   * 
-   * @return true if view has hidden rows
-   */
-  public boolean hasHiddenRows()
-  {
-    return hasHiddenRows;
-  }
-
-  /**
-   * 
-   * @return true if view has hidden columns
-   */
-  public boolean hasHiddenColumns()
-  {
-    return hasHiddenColumns;
-  }
 
   /**
    * when set, view will scroll to show the highlighted position
@@ -1262,4 +1198,15 @@ public class AlignViewport extends AlignmentViewport implements
   {
     this.showAutocalculatedAbove = showAutocalculatedAbove;
   }
+
+  public AnnotationColumnChooser getAnnotationColumnSelectionState()
+  {
+    return annotationColumnSelectionState;
+  }
+
+  public void setAnnotationColumnSelectionState(
+          AnnotationColumnChooser currentAnnotationColumnSelectionState)
+  {
+    this.annotationColumnSelectionState = currentAnnotationColumnSelectionState;
+  }
 }