JAL-3199 'Sort Annotations by...' now a one-off action, not a 'state'
[jalview.git] / src / jalview / jbgui / GAlignFrame.java
index 50ee6c8..3aebcda 100755 (executable)
@@ -204,9 +204,9 @@ public class GAlignFrame extends JInternalFrame
 
   private SplitContainerI splitFrame;
 
-  protected JCheckBoxMenuItem sortAnnBySequence;
+  protected JMenuItem sortAnnBySequence;
 
-  protected JCheckBoxMenuItem sortAnnByLabel;
+  protected JMenuItem sortAnnByLabel;
 
   protected JMenu annotationsMenu;
 
@@ -609,33 +609,21 @@ public class GAlignFrame extends JInternalFrame
     sortAnnByLabel = new JCheckBoxMenuItem(
             MessageManager.getString("label.sort_annotations_by_label"));
 
-    sortAnnBySequence.setSelected(
-            sortAnnotationsBy == SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
     sortAnnBySequence.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        boolean newState = sortAnnBySequence.getState();
-        sortAnnByLabel.setSelected(false);
-        setAnnotationSortOrder(
-                newState ? SequenceAnnotationOrder.SEQUENCE_AND_LABEL
-                        : SequenceAnnotationOrder.NONE);
+        setAnnotationSortOrder(SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
         sortAnnotations();
       }
     });
-    sortAnnByLabel.setSelected(
-            sortAnnotationsBy == SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
     sortAnnByLabel.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        boolean newState = sortAnnByLabel.getState();
-        sortAnnBySequence.setSelected(false);
-        setAnnotationSortOrder(
-                newState ? SequenceAnnotationOrder.LABEL_AND_SEQUENCE
-                        : SequenceAnnotationOrder.NONE);
+        setAnnotationSortOrder(SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
         sortAnnotations();
       }
     });