JAL-1152 set initial state of show alignment/sequence annotations menu
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 21 Sep 2015 11:44:07 +0000 (12:44 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 21 Sep 2015 11:44:07 +0000 (12:44 +0100)
src/jalview/appletgui/AlignFrame.java

index 2a2fc81..a8d73ee 100644 (file)
@@ -234,8 +234,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     normSequenceLogo.setState(viewport.isNormaliseSequenceLogo());
     applyToAllGroups.setState(viewport.getColourAppliesToAllGroups());
     annotationPanelMenuItem.setState(viewport.isShowAnnotation());
-    showAlignmentAnnotations.setState(viewport.isShowAnnotation());
-    showSequenceAnnotations.setState(viewport.isShowAnnotation());
+    showAlignmentAnnotations.setEnabled(annotationPanelMenuItem.getState());
+    showSequenceAnnotations.setEnabled(annotationPanelMenuItem.getState());
+    showAlignmentAnnotations.setState(true);
+    showSequenceAnnotations.setState(false);
 
     seqLimits.setState(viewport.getShowJVSuffix());
 
@@ -816,8 +818,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     }
     else if (source == annotationPanelMenuItem)
     {
-      viewport.setShowAnnotation(annotationPanelMenuItem.getState());
-      alignPanel.setAnnotationVisible(annotationPanelMenuItem.getState());
+      boolean showAnnotations = annotationPanelMenuItem.getState();
+      showAlignmentAnnotations.setEnabled(showAnnotations);
+      showSequenceAnnotations.setEnabled(showAnnotations);
+      viewport.setShowAnnotation(showAnnotations);
+      alignPanel.setAnnotationVisible(showAnnotations);
     }
     else if (source == sequenceFeatures)
     {