JAL-1865 fixed so initial state of annotation sort options matches
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 14 Sep 2015 14:50:41 +0000 (15:50 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 14 Sep 2015 14:50:41 +0000 (15:50 +0100)
display

src/jalview/appletgui/AlignFrame.java
src/jalview/gui/AlignFrame.java
src/jalview/jbgui/GAlignFrame.java

index 3996dee..c9183d5 100644 (file)
@@ -302,6 +302,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     alignPanel.annotationSpaceFillerHolder.addKeyListener(this);
     alignPanel.alabels.addKeyListener(this);
 
+    setAnnotationsVisibility();
+
     if (addToDisplay)
     {
       addToDisplay(embedded);
@@ -913,7 +915,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
   /**
    * Set the visibility state of sequence-related and/or alignment-related
-   * annotations depending on checkbox selections. Repaint after calling.
+   * annotations depending on checkbox selections, and repaint.
    * 
    * @param visible
    */
@@ -3357,8 +3359,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
             MessageManager.getString("label.sort_annotations_by_label"));
     showAutoFirst = new CheckboxMenuItem(
             MessageManager.getString("label.show_first"));
+    showAutoFirst.setState(false); // pending applet parameter
+    setShowAutoCalculatedAbove(showAutoFirst.getState());
     showAutoLast = new CheckboxMenuItem(
             MessageManager.getString("label.show_last"));
+    showAutoLast.setState(!showAutoFirst.getState());
     showAlignmentAnnotations.addItemListener(this);
     showSequenceAnnotations.addItemListener(this);
     sortAnnBySequence.addItemListener(this);
index 500dfdb..88271b9 100644 (file)
@@ -368,6 +368,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       setGUINucleotide(viewport.getAlignment().isNucleotide());
     }
 
+    this.alignPanel.av
+            .setShowAutocalculatedAbove(isShowAutoCalculatedAbove());
+
     setMenusFromViewport(viewport);
     buildSortByAnnotationScoresMenu();
     buildTreeMenu();
index 8d18064..73d34c2 100755 (executable)
@@ -1295,8 +1295,10 @@ public class GAlignFrame extends JInternalFrame
             MessageManager.getString("label.show_last"));
     buttonGroup.add(showAutoFirst);
     buttonGroup.add(showAutoLast);
-    showAutoFirst.setSelected(Cache.getDefault(
-            Preferences.SHOW_AUTOCALC_ABOVE, false));
+    final boolean autoFirst = Cache.getDefault(
+            Preferences.SHOW_AUTOCALC_ABOVE, false);
+    showAutoFirst.setSelected(autoFirst);
+    setShowAutoCalculatedAbove(autoFirst);
     showAutoFirst.addActionListener(new ActionListener()
     {
       @Override