Merge branch 'features/JAL-2360colourSchemeApplicability' into features/JAL-2371colle...
[jalview.git] / src / jalview / gui / AnnotationRowFilter.java
index 79b00b9..166e1ad 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
- * Copyright (C) 2015 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -366,23 +366,20 @@ public abstract class AnnotationRowFilter extends JPanel
           continue;
         }
 
+        AnnotationColourGradient scheme = null;
         if (currentColours.isSelected())
         {
-          sg.cs = new AnnotationColourGradient(currentAnn, sg.cs,
-                  selectedThresholdOption);
-          ((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated
-                  .isSelected());
-
+          scheme = new AnnotationColourGradient(currentAnn,
+                  sg.getColourScheme(), selectedThresholdOption);
         }
         else
         {
-          sg.cs = new AnnotationColourGradient(currentAnn,
+          scheme = new AnnotationColourGradient(currentAnn,
                   minColour.getBackground(), maxColour.getBackground(),
                   selectedThresholdOption);
-          ((AnnotationColourGradient) sg.cs).setSeqAssociated(seqAssociated
-                  .isSelected());
         }
-
+        scheme.setSeqAssociated(seqAssociated.isSelected());
+        sg.setColourScheme(scheme);
       }
     }
     return false;