X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FAnnotationColourGradient.java;h=f467cb8c108777d95ace28bd4ca5fdebabc08e12;hb=7ab5d6b0ba5fec1ea4a4239e79c476d841622485;hp=e6128c9a6dcf541ce256e17b5e056044016956e8;hpb=1889827c44c51f6353fe8619e5d44b421158af23;p=jalview.git diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index e6128c9..f467cb8 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -54,13 +54,16 @@ public class AnnotationColourGradient extends FollowerColourScheme private boolean seqAssociated = false; IdentityHashMap seqannot = null; + @Override public ColourSchemeI applyTo(AnnotatedCollectionI sg, Map hiddenRepSequences) { - AnnotationColourGradient acg = new AnnotationColourGradient(annotation, colourScheme, aboveAnnotationThreshold); + AnnotationColourGradient acg = new AnnotationColourGradient(annotation, + colourScheme, aboveAnnotationThreshold); acg.thresholdIsMinMax = thresholdIsMinMax; - acg.annotationThreshold = (annotationThreshold==null) ? null : new GraphLine(annotationThreshold); + acg.annotationThreshold = (annotationThreshold == null) ? null + : new GraphLine(annotationThreshold); acg.r1 = r1; acg.g1 = g1; acg.b1 = b1; @@ -72,9 +75,10 @@ public class AnnotationColourGradient extends FollowerColourScheme acg.db = db; acg.predefinedColours = predefinedColours; acg.seqAssociated = seqAssociated; - + return acg; } + /** * Creates a new AnnotationColourGradient object. */ @@ -141,7 +145,8 @@ public class AnnotationColourGradient extends FollowerColourScheme seqannot = new IdentityHashMap(); } // resolve the context containing all the annotation for the sequence - AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment : alignment.getContext(); + AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment + : alignment.getContext(); for (AlignmentAnnotation alan : alcontext.findAnnotation(annotation .getCalcId())) { @@ -222,7 +227,8 @@ public class AnnotationColourGradient extends FollowerColourScheme } if ((threshold == 0) || aboveThreshold(c, j)) { - if (annotation.annotations!=null && j < annotation.annotations.length + if (annotation.annotations != null + && j < annotation.annotations.length && annotation.annotations[j] != null && !jalview.util.Comparison.isGap(c)) { @@ -268,7 +274,7 @@ public class AnnotationColourGradient extends FollowerColourScheme { currentColour = colourScheme.findColour(c, j, seq); } - else + else { dr = rr * range + r1; dg = gg * range + g1;