From 3f873f476a41c07e5c5b0ca2ac36e54411d07fe0 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 14 Jan 2019 15:04:04 +0000 Subject: [PATCH] JAL-3186 reorder popup menu slightly --- src/jalview/gui/FeatureSettings.java | 65 +++++++++++++++++----------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 37a51ef..77d5622 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -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")); -- 1.7.10.2