X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fschemes%2FAnnotationColourGradient.java;h=5461ec0ff1b5a3c26045e7e6d5c6baa64aa158f1;hb=595a9e25db7f4f24c17de84656d7d5391a3d104d;hp=5e48fc48c1fd3c89cc7ffc7c95ccd7d1529052b4;hpb=62babeb3c6572d8f11e64292febf1e6a382f1fca;p=jalview.git diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index 5e48fc4..5461ec0 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -20,6 +20,7 @@ */ package jalview.schemes; +import jalview.api.AlignViewportI; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.AnnotatedCollectionI; @@ -76,8 +77,8 @@ public class AnnotationColourGradient extends FollowerColourScheme private IdentityHashMap seqannot = null; @Override - public ColourSchemeI getInstance(AnnotatedCollectionI sg, - Map hiddenRepSequences) + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI sg) { AnnotationColourGradient acg = new AnnotationColourGradient(annotation, getColourScheme(), aboveAnnotationThreshold); @@ -166,8 +167,8 @@ public class AnnotationColourGradient extends FollowerColourScheme if (annotation.isRNA()) { // reset colour palette - ColourSchemeProperty.resetRnaHelicesShading(); - ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax); + ColourSchemes.resetRnaHelicesShading(); + ColourSchemes.initRnaHelicesShading(1 + (int) aamax); } } @@ -217,7 +218,7 @@ public class AnnotationColourGradient extends FollowerColourScheme } if (rna) { - ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax); + ColourSchemes.initRnaHelicesShading(1 + (int) aamax); } } } @@ -319,9 +320,9 @@ public class AnnotationColourGradient extends FollowerColourScheme if (annotationThreshold != null) { if ((aboveAnnotationThreshold == ABOVE_THRESHOLD - && aj.value < annotationThreshold.value) + && aj.value <= annotationThreshold.value) || (aboveAnnotationThreshold == BELOW_THRESHOLD - && aj.value > annotationThreshold.value)) + && aj.value >= annotationThreshold.value)) { return Color.white; } @@ -354,7 +355,7 @@ public class AnnotationColourGradient extends FollowerColourScheme { if (ann.isRNA()) { - result = ColourSchemeProperty.rnaHelices[(int) aj.value]; + result = ColourSchemes.getInstance().rnaHelices[(int) aj.value]; } else { @@ -414,14 +415,17 @@ public class AnnotationColourGradient extends FollowerColourScheme && aboveAnnotationThreshold == ABOVE_THRESHOLD && value >= ann.threshold.value) { - range = (value - ann.threshold.value) + range = ann.graphMax == ann.threshold.value ? 1f + : (value - ann.threshold.value) / (ann.graphMax - ann.threshold.value); } else if (thresholdIsMinMax && ann.threshold != null && aboveAnnotationThreshold == BELOW_THRESHOLD && value <= ann.threshold.value) { - range = (value - ann.graphMin) / (ann.threshold.value - ann.graphMin); + range = ann.graphMin == ann.threshold.value ? 0f + : (value - ann.graphMin) + / (ann.threshold.value - ann.graphMin); } else {