JAL-3186 reorder popup menu slightly
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 14 Jan 2019 15:04:04 +0000 (15:04 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 14 Jan 2019 15:04:04 +0000 (15:04 +0000)
src/jalview/gui/FeatureSettings.java

index 37a51ef..77d5622 100644 (file)
@@ -442,41 +442,13 @@ public class FeatureSettings extends JPanel
   protected void showPopupMenu(final int rowSelected, final String type,
           final Object typeCol, final Point pt)
   {
-    final FeatureColourI featureColour = (FeatureColourI) typeCol;
-
     JPopupMenu men = new JPopupMenu(MessageManager
             .formatMessage("label.settings_for_param", new String[]
             { type }));
-    JMenuItem scr = new JMenuItem(
-            MessageManager.getString("label.sort_by_score"));
-    men.add(scr);
-    scr.addActionListener(new ActionListener()
-    {
-
-      @Override
-      public void actionPerformed(ActionEvent e)
-      {
-        af.avc.sortAlignmentByFeatureScore(Arrays.asList(new String[]
-                { type }));
-      }
-    });
-    JMenuItem dens = new JMenuItem(
-            MessageManager.getString("label.sort_by_density"));
-    dens.addActionListener(new ActionListener()
-    {
-
-      @Override
-      public void actionPerformed(ActionEvent e)
-      {
-        af.avc.sortAlignmentByFeatureDensity(Arrays.asList(new String[]
-                { type }));
-      }
-    });
-    men.add(dens);
+    final FeatureColourI featureColour = (FeatureColourI) typeCol;
 
     /*
-     * variable colour options include colour by label, by score,
-     * by selected attribute text, or attribute value
+     * menu option to select (or deselect) variable colour
      */
     final JCheckBoxMenuItem variableColourCB = new JCheckBoxMenuItem(
             MessageManager.getString("label.variable_colour"));
@@ -538,12 +510,41 @@ public class FeatureSettings extends JPanel
             FeatureColourI fci = fr.getFeatureColours().get(type);
             table.setValueAt(fci, rowSelected, COLOUR_COLUMN);
             // BH 2018 setting a table value does not invalidate it.
-//            System.out.println("FeatureSettings is valied" + table.isValid());
-//            table.validate();
+//                 System.out.println("FeatureSettings is valied" + table.isValid());
+//                 table.validate();
           }
         }
       }
     });
+    
+    men.addSeparator();
+
+    JMenuItem scr = new JMenuItem(
+            MessageManager.getString("label.sort_by_score"));
+    men.add(scr);
+    scr.addActionListener(new ActionListener()
+    {
+
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        af.avc.sortAlignmentByFeatureScore(Arrays.asList(new String[]
+                { type }));
+      }
+    });
+    JMenuItem dens = new JMenuItem(
+            MessageManager.getString("label.sort_by_density"));
+    dens.addActionListener(new ActionListener()
+    {
+
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        af.avc.sortAlignmentByFeatureDensity(Arrays.asList(new String[]
+                { type }));
+      }
+    });
+    men.add(dens);
 
     JMenuItem selCols = new JMenuItem(
             MessageManager.getString("label.select_columns_containing"));