Allow operation if no groups exist
authoramwaterhouse <Andrew Waterhouse>
Fri, 3 Dec 2004 16:28:19 +0000 (16:28 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 3 Dec 2004 16:28:19 +0000 (16:28 +0000)
src/jalview/gui/GroupEditor.java

index 5b6df2b..b4dd9cf 100755 (executable)
@@ -29,8 +29,11 @@ public class GroupEditor extends GGroupEditor
     for (int i=0; i < ColourProperties.getColourSchemeNames().size(); i++)\r
        colourCombo.addItem(ColourProperties.getColourSchemeNames().elementAt(i));\r
 \r
-    showGroup();\r
-    updateGroupcombo();\r
+     if(groups.size()>0)\r
+     {\r
+       showGroup();\r
+       updateGroupcombo();\r
+     }\r
 \r
     assignedList.addMouseListener( new MouseAdapter()\r
     {\r
@@ -111,6 +114,9 @@ public class GroupEditor extends GGroupEditor
 \r
   void showGroup()\r
   {\r
+    if(groups.size()<1)\r
+       return;\r
+\r
     assignedVector = new Vector();\r
     if(selectedGroupIndex!=-1)\r
     {\r
@@ -155,6 +161,9 @@ public class GroupEditor extends GGroupEditor
 \r
   protected void colourCombo_actionPerformed(ActionEvent e)\r
   {\r
+     if(groups.size()<1)\r
+       return;\r
+\r
      SequenceGroup sg = (SequenceGroup)groups.elementAt(selectedGroupIndex);\r
 \r
      sg.cs = ColourSchemeFactory.get( (String)colourCombo.getSelectedItem() );\r