JAL-3199 'Sort Annotations by...' now a one-off action, not a 'state'
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 14 Nov 2019 14:28:20 +0000 (14:28 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 14 Nov 2019 14:28:20 +0000 (14:28 +0000)
help/html/menus/alignmentMenu.html
src/jalview/gui/AlignFrame.java
src/jalview/jbgui/GAlignFrame.java

index 3a057a8..18cff25 100755 (executable)
             alignment (and within that, by label).</em></li>
         <li><strong>Sort by Label</strong><em><br>Sort
             sequence-specific annotations by label (and within that, by
-            sequence order). If neither sort order is selected, no
-            sorting is applied, allowing you to make a manual ordering
-            of the annotations.</em></li>
+            sequence order).</em></li>
         <li><strong>Autocalculated Annotation<br>
         </strong><em>Settings for the display of autocalculated annotation.</em>
           <ul>
index 092cf47..1b1178f 100644 (file)
@@ -146,8 +146,6 @@ import javax.swing.JMenu;
 import javax.swing.JMenuItem;
 import javax.swing.JScrollPane;
 import javax.swing.SwingUtilities;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
 
 /**
  * DOCUMENT ME!
@@ -481,34 +479,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       }
     });
 
-    /*
-     * ensure By Label/Sequence are not selected if annotations
-     * have been reordered manually to CUSTOM order
-     */
-    annotationsMenu.addMenuListener(new MenuListener()
-    {
-      @Override
-      public void menuSelected(MenuEvent e)
-      {
-        SequenceAnnotationOrder sortAnnotationsBy = viewport
-                .getSortAnnotationsBy();
-        sortAnnByLabel.setSelected(
-                sortAnnotationsBy == SequenceAnnotationOrder.LABEL_AND_SEQUENCE);
-        sortAnnBySequence.setSelected(
-                sortAnnotationsBy == SequenceAnnotationOrder.SEQUENCE_AND_LABEL);
-      }
-
-      @Override
-      public void menuDeselected(MenuEvent e)
-      {
-      }
-
-      @Override
-      public void menuCanceled(MenuEvent e)
-      {
-      }
-    });
-
     alignPanel.sortAnnotations();
   }
 
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();
       }
     });