JAL-1871 choose a new RNA Helices palette when annotation colouring is updated
authorJim Procter <jprocter@issues.jalview.org>
Sat, 5 Sep 2015 17:40:05 +0000 (18:40 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Sat, 5 Sep 2015 17:40:05 +0000 (18:40 +0100)
src/jalview/schemes/AnnotationColourGradient.java

index 121d6ca..133dd36 100755 (executable)
@@ -114,6 +114,7 @@ public class AnnotationColourGradient extends FollowerColourScheme
     bb = 0;
 
     noGradient = true;
+    checkLimits();
   }
 
   /**
@@ -140,10 +141,17 @@ public class AnnotationColourGradient extends FollowerColourScheme
     bb = maxColour.getBlue() - b1;
 
     noGradient = false;
+    checkLimits();
+  }
+
+  private void checkLimits()
+  {
     aamax = annotation.graphMax;
     aamin = annotation.graphMin;
     if (annotation.isRNA())
     {
+      // reset colour palette
+      ColourSchemeProperty.resetRnaHelicesShading();
       ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
     }
   }