JAL-1608 leave Create Group, Remove Group menu items enabled
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 30 Mar 2017 14:10:17 +0000 (15:10 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 30 Mar 2017 14:10:17 +0000 (15:10 +0100)
src/jalview/gui/AlignFrame.java
src/jalview/jbgui/GAlignFrame.java

index 445e967..ab1ac0e 100644 (file)
@@ -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<SequenceGroup> groups = viewport.getAlignment().getGroups();
-      createGroup.setEnabled(groups == null || !groups.contains(sg));
-      unGroup.setEnabled(groups != null && groups.contains(sg));
-    }
-  }
 }
 
 class PrintThread extends Thread
index 1302cdd..7164f31 100755 (executable)
@@ -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()