JAL-2015 restore check for null colour in paint()
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 18 Jul 2016 13:10:40 +0000 (14:10 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 18 Jul 2016 13:10:40 +0000 (14:10 +0100)
src/jalview/appletgui/FeatureSettings.java

index bfac241..9733c86 100755 (executable)
@@ -763,28 +763,31 @@ public class FeatureSettings extends Panel implements ItemListener,
     public void paint(Graphics g)
     {
       Dimension d = getSize();
-      if (col.isColourByLabel())
+      if (col != null)
       {
-        g.setColor(Color.white);
-        g.fillRect(d.width / 2, 0, d.width / 2, d.height);
-        /*
-         * g.setColor(Color.black); Font f=g.getFont().deriveFont(9);
-         * g.setFont(f);
-         * 
-         * // g.setFont(g.getFont().deriveFont( //
-         * AffineTransform.getScaleInstance( //
-         * width/g.getFontMetrics().stringWidth("Label"), //
-         * height/g.getFontMetrics().getHeight()))); g.drawString("Label",
-         * width/2, 0);
-         */
+        if (col.isColourByLabel())
+        {
+          g.setColor(Color.white);
+          g.fillRect(d.width / 2, 0, d.width / 2, d.height);
+          /*
+           * g.setColor(Color.black); Font f=g.getFont().deriveFont(9);
+           * g.setFont(f);
+           * 
+           * // g.setFont(g.getFont().deriveFont( //
+           * AffineTransform.getScaleInstance( //
+           * width/g.getFontMetrics().stringWidth("Label"), //
+           * height/g.getFontMetrics().getHeight()))); g.drawString("Label",
+           * width/2, 0);
+           */
 
-      }
-      else if (col.isGraduatedColour())
-      {
-        Color maxCol = col.getMaxColour();
-        g.setColor(maxCol);
-        g.fillRect(d.width / 2, 0, d.width / 2, d.height);
+        }
+        else if (col.isGraduatedColour())
+        {
+          Color maxCol = col.getMaxColour();
+          g.setColor(maxCol);
+          g.fillRect(d.width / 2, 0, d.width / 2, d.height);
 
+        }
       }
 
       if (hasLink)