From 3965e9e3bc4ca05dcc82b8dc72c380f208c9a1e6 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 30 Mar 2017 15:10:17 +0100 Subject: [PATCH] JAL-1608 leave Create Group, Remove Group menu items enabled --- src/jalview/gui/AlignFrame.java | 17 ----------------- src/jalview/jbgui/GAlignFrame.java | 25 ++----------------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 445e967..ab1ac0e 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5705,23 +5705,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, ColourMenuHelper.setColourSelected(colourMenu, schemeName); } - - /** - * Disable inapplicable items in the Select menu when it is clicked - */ - @Override - protected void configureSelectMenu() - { - createGroup.setEnabled(false); - unGroup.setEnabled(false); - SequenceGroup sg = viewport.getSelectionGroup(); - if (sg != null) - { - List groups = viewport.getAlignment().getGroups(); - createGroup.setEnabled(groups == null || !groups.contains(sg)); - unGroup.setEnabled(groups != null && groups.contains(sg)); - } - } } class PrintThread extends Thread diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 1302cdd..7164f31 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -203,10 +203,6 @@ public class GAlignFrame extends JInternalFrame private SplitContainerI splitFrame; - protected JMenuItem createGroup; - - protected JMenuItem unGroup; - public GAlignFrame() { try @@ -978,7 +974,7 @@ public class GAlignFrame extends JInternalFrame } }); - createGroup = new JMenuItem( + JMenuItem createGroup = new JMenuItem( MessageManager.getString("action.create_group")); keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, Toolkit .getDefaultToolkit().getMenuShortcutKeyMask(), false); @@ -992,7 +988,7 @@ public class GAlignFrame extends JInternalFrame }; addMenuActionAndAccelerator(keyStroke, createGroup, al); - unGroup = new JMenuItem( + JMenuItem unGroup = new JMenuItem( MessageManager.getString("action.remove_group")); keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_G, Toolkit .getDefaultToolkit().getMenuShortcutKeyMask() @@ -1657,24 +1653,7 @@ public class GAlignFrame extends JInternalFrame formatMenu.setText(MessageManager.getString("action.format")); JMenu selectMenu = new JMenu(MessageManager.getString("action.select")); - selectMenu.addMenuListener(new MenuListener() - { - @Override - public void menuSelected(MenuEvent e) - { - configureSelectMenu(); - } - @Override - public void menuDeselected(MenuEvent e) - { - } - - @Override - public void menuCanceled(MenuEvent e) - { - } - }); idRightAlign.setText(MessageManager .getString("label.right_align_sequence_id")); idRightAlign.addActionListener(new ActionListener() -- 1.7.10.2