JAL-2360 fix bug that prematurely created a SequenceGroup
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 22 Dec 2016 14:03:20 +0000 (14:03 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 22 Dec 2016 14:03:20 +0000 (14:03 +0000)
src/jalview/gui/PopupMenu.java

index c660ab5..ffa8b9c 100644 (file)
@@ -987,15 +987,14 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
     });
     createGroupMenuItem.setText(MessageManager
             .getString("action.create_group"));
-    createGroupMenuItem
-.addActionListener(new ActionListener()
-            {
-              @Override
-              public void actionPerformed(ActionEvent e)
-              {
-                createGroupMenuItem_actionPerformed();
-              }
-            });
+    createGroupMenuItem.addActionListener(new ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        createGroupMenuItem_actionPerformed();
+      }
+    });
 
     outline.setText(MessageManager.getString("action.border_colour"));
     outline.addActionListener(new ActionListener()
@@ -1270,7 +1269,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
    */
   protected void buildColourMenu()
   {
-    SequenceGroup sg = getGroup();
+    SequenceGroup sg = ap.av.getSelectionGroup();
     if (sg == null)
     {
       /*