JAL-2089 patch broken merge to master for Release 2.10.0b1
[jalview.git] / src / jalview / appletgui / FeatureSettings.java
index bfac241..2c454a4 100755 (executable)
@@ -185,8 +185,7 @@ public class FeatureSettings extends Panel implements ItemListener,
   }
 
   protected void popupSort(final MyCheckbox check,
-          final Map<String, float[][]> minmax,
-          int x, int y)
+          final Map<String, float[][]> minmax, int x, int y)
   {
     final String type = check.type;
     final FeatureColourI typeCol = fr.getFeatureStyle(type);
@@ -763,28 +762,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)
@@ -801,11 +803,10 @@ public class FeatureSettings extends Panel implements ItemListener,
    * @param type
    * @param columnsContaining
    */
-  void hideFeatureColumns(final String type,
-          boolean columnsContaining)
+  void hideFeatureColumns(final String type, boolean columnsContaining)
   {
-    if (ap.alignFrame.avc.markColumnsContainingFeatures(
-            columnsContaining, false, false, type))
+    if (ap.alignFrame.avc.markColumnsContainingFeatures(columnsContaining,
+            false, false, type))
     {
       if (ap.alignFrame.avc.markColumnsContainingFeatures(
               !columnsContaining, false, false, type))