JAL-4090 defensive check for featureSettings redraws when feature filter attrbute...
[jalview.git] / src / jalview / gui / FeatureSettings.java
index e8e6f1a..4d31805 100644 (file)
@@ -948,14 +948,9 @@ public class FeatureSettings extends JPanel
     chooser.setDialogTitle(
             MessageManager.getString("label.load_feature_colours"));
     chooser.setToolTipText(MessageManager.getString("action.load"));
-    chooser.setResponseHandler(0, new Runnable()
-    {
-      @Override
-      public void run()
-      {
-        File file = chooser.getSelectedFile();
-        load(file);
-      }
+    chooser.setResponseHandler(0, () -> {
+      File file = chooser.getSelectedFile();
+      load(file);
     });
     chooser.showOpenDialog(this);
   }
@@ -1024,7 +1019,7 @@ public class FeatureSettings extends JPanel
       }
     } catch (Exception ex)
     {
-      System.out.println("Error loading User Colour File\n" + ex);
+      jalview.bin.Console.outPrintln("Error loading User Colour File\n" + ex);
     }
   }
 
@@ -1613,7 +1608,7 @@ public class FeatureSettings extends JPanel
     {
       Color newColor = gcol.getMaxColour();
       comp.setBackground(newColor);
-      // System.err.println("Width is " + w / 2);
+      // jalview.bin.Console.errPrintln("Width is " + w / 2);
       Icon ficon = new FeatureIcon(gcol, comp.getBackground(), w, h, thr);
       comp.setIcon(ficon);
       // tt+="RGB value: Max (" + newColor.getRed() + ", "
@@ -1792,11 +1787,15 @@ public class FeatureSettings extends JPanel
     {
       FeatureMatcherSetI theFilter = (FeatureMatcherSetI) filter;
       setOpaque(true);
-      String asText = theFilter.toString();
       setBackground(tbl.getBackground());
-      this.setText(asText);
       this.setIcon(null);
 
+      if (theFilter != null)
+      {
+        String asText = theFilter.toString();
+        this.setText(asText);
+      }
+
       if (isSelected)
       {
         if (selectedBorder == null)