JAL-2401 fix for NPE on selectedButtons, tweak for button appearance
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 8 Feb 2017 14:43:36 +0000 (14:43 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 8 Feb 2017 14:43:36 +0000 (14:43 +0000)
src/jalview/gui/UserDefinedColours.java

index e1a43d9..10a9687 100755 (executable)
@@ -101,7 +101,7 @@ public class UserDefinedColours extends GUserDefinedColours implements
    */
   public UserDefinedColours(AlignmentPanel ap, SequenceGroup sg)
   {
-    super();
+    this();
 
     lcaseColour.setEnabled(false);
 
@@ -124,6 +124,7 @@ public class UserDefinedColours extends GUserDefinedColours implements
       {
         caseSensitive.setSelected(true);
         lcaseColour.setEnabled(true);
+        lcaseColour.setForeground(Color.GRAY);
         resetButtonPanel(true);
       }
       else
@@ -142,7 +143,7 @@ public class UserDefinedColours extends GUserDefinedColours implements
   public UserDefinedColours(JalviewStructureDisplayI viewer,
           ColourSchemeI oldcs)
   {
-    super();
+    this();
     this.structureViewer = viewer;
 
     colorChooser.getSelectionModel().addChangeListener(this);
@@ -161,6 +162,12 @@ public class UserDefinedColours extends GUserDefinedColours implements
 
   }
 
+  public UserDefinedColours()
+  {
+    super();
+    selectedButtons = new ArrayList<JButton>();
+  }
+
   void showFrame()
   {
     colorChooser.getSelectionModel().addChangeListener(this);
@@ -629,6 +636,7 @@ public class UserDefinedColours extends GUserDefinedColours implements
     {
       caseSensitive.setSelected(true);
       lcaseColour.setEnabled(true);
+      lcaseColour.setForeground(Color.GRAY);
       resetButtonPanel(true);
       for (int i = 0; i < lowerCaseButtons.size(); i++)
       {