JAL-2371 CollectionColourScheme wraps ColourSchemeI
[jalview.git] / src / jalview / appletgui / AnnotationColourChooser.java
index 79d2f1f..487b75c 100644 (file)
@@ -81,9 +81,9 @@ public class AnnotationColourChooser extends Panel implements
       oldgroupColours = new Hashtable();
       for (SequenceGroup sg : ap.av.getAlignment().getGroups())
       {
-        if (sg.cs != null)
+        if (sg.getColourScheme() != null)
         {
-          oldgroupColours.put(sg, sg.cs);
+          oldgroupColours.put(sg, sg.getColourScheme());
         }
         else
         {
@@ -487,8 +487,6 @@ public class AnnotationColourChooser extends Panel implements
     AnnotationColourGradient acg = null;
     if (currentColours.getState())
     {
-      acg = new AnnotationColourGradient(currentAnnotation,
-              av.getGlobalColourScheme(), aboveThreshold);
     }
     else
     {
@@ -513,21 +511,21 @@ public class AnnotationColourChooser extends Panel implements
       for (SequenceGroup sg : ap.av.getAlignment().getGroups())
       {
 
-        if (sg.cs == null)
+        if (sg.getColourScheme() == null)
         {
           continue;
         }
 
         if (currentColours.getState())
         {
-          sg.cs = new AnnotationColourGradient(currentAnnotation, sg.cs,
-                  aboveThreshold);
+          sg.setColourScheme(new AnnotationColourGradient(
+                  currentAnnotation, sg.getColourScheme(), aboveThreshold));
         }
         else
         {
-          sg.cs = new AnnotationColourGradient(currentAnnotation,
-                  minColour.getBackground(), maxColour.getBackground(),
-                  aboveThreshold);
+          sg.setColourScheme(new AnnotationColourGradient(
+                  currentAnnotation, minColour.getBackground(), maxColour
+                          .getBackground(), aboveThreshold));
         }
 
       }
@@ -548,12 +546,12 @@ public class AnnotationColourChooser extends Panel implements
         Object cs = oldgroupColours.get(sg);
         if (cs instanceof ColourSchemeI)
         {
-          sg.cs = (ColourSchemeI) cs;
+          sg.setColourScheme((ColourSchemeI) cs);
         }
         else
         {
           // probably the "null" string we set it to if it was null originally.
-          sg.cs = null;
+          sg.setColourScheme(null);
         }
       }
     }