JAL-1152 menu tweaks plus new option to put Autocalc at top or below.
[jalview.git] / src / jalview / gui / AlignViewport.java
index 6969513..5c07f6e 100644 (file)
@@ -38,7 +38,7 @@
  */
 package jalview.gui;
 
-import jalview.analysis.AnnotationSorter.SortOrder;
+import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.analysis.NJTree;
 import jalview.api.AlignViewportI;
 import jalview.bin.Cache;
@@ -100,7 +100,7 @@ public class AlignViewport extends AlignmentViewport implements
 
   boolean showAnnotation = true;
 
-  SortOrder sortAnnotationsBy = null;
+  SequenceAnnotationOrder sortAnnotationsBy = null;
 
   int charHeight;
 
@@ -362,13 +362,13 @@ public class AlignViewport extends AlignmentViewport implements
     }
 
     wrapAlignment = Cache.getDefault("WRAP_ALIGNMENT", false);
-    showUnconserved = Cache.getDefault("SHOW_UNCONSERVED",
-            false);
+    showUnconserved = Cache.getDefault("SHOW_UNCONSERVED", false);
     sortByTree = Cache.getDefault("SORT_BY_TREE", false);
-    followSelection = Cache.getDefault("FOLLOW_SELECTIONS",
-            true);
-    sortAnnotationsBy = SortOrder.valueOf(Cache.getDefault(
-            "SORT_ANNOTATIONS", SortOrder.SEQUENCE_AND_TYPE.name()));
+    followSelection = Cache.getDefault("FOLLOW_SELECTIONS", true);
+    sortAnnotationsBy = SequenceAnnotationOrder.valueOf(Cache.getDefault(
+            "SORT_ANNOTATIONS", SequenceAnnotationOrder.SEQUENCE_AND_LABEL.name()));
+    showAutocalculatedAbove = Cache
+            .getDefault("SHOW_AUTOCALC_ABOVE", false);
   }
 
   /**
@@ -1258,6 +1258,8 @@ public class AlignViewport extends AlignmentViewport implements
 
   private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<String, AutoCalcSetting>();
 
+  private boolean showAutocalculatedAbove;
+
   public AutoCalcSetting getCalcIdSettingsFor(String calcId)
   {
     return calcIdParams.get(calcId);
@@ -1276,13 +1278,23 @@ public class AlignViewport extends AlignmentViewport implements
     }
   }
 
-  protected SortOrder getSortAnnotationsBy()
+  protected SequenceAnnotationOrder getSortAnnotationsBy()
   {
     return sortAnnotationsBy;
   }
 
-  protected void setSortAnnotationsBy(SortOrder sortAnnotationsBy)
+  protected void setSortAnnotationsBy(SequenceAnnotationOrder sortAnnotationsBy)
   {
     this.sortAnnotationsBy = sortAnnotationsBy;
   }
+
+  protected boolean isShowAutocalculatedAbove()
+  {
+    return showAutocalculatedAbove;
+  }
+
+  protected void setShowAutocalculatedAbove(boolean showAutocalculatedAbove)
+  {
+    this.showAutocalculatedAbove = showAutocalculatedAbove;
+  }
 }