Merge branch 'features/JAL-2295setChimeraAttributes' into
[jalview.git] / src / jalview / gui / AnnotationRowFilter.java
index 1b036c1..7705bc3 100644 (file)
@@ -376,23 +376,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;