X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fschemes%2FAnnotationColourGradient.java;h=121d6ca03daf8c1717ecee8bbd65b5766de26de7;hb=2b0142bf85bf5b3d20612c01433e7ce29b633ec4;hp=ef77e4dff0c7b8a3abc9f91948809840100b35b4;hpb=9a8cd338482d62f30297119ac6273da5f5b6ea6c;p=jalview.git diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index ef77e4d..121d6ca 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -53,33 +53,6 @@ public class AnnotationColourGradient extends FollowerColourScheme private boolean predefinedColours = false; private boolean seqAssociated = false; - Color rnaHelices[] = null; - private void initRnaHelicesShading(int n) - { - int j = 0; - if (rnaHelices==null) - { - rnaHelices = new Color[n + 1]; - } - else - if (rnaHelices != null && rnaHelices.length <= n) - { - Color[] t = new Color[n + 1]; - System.arraycopy(rnaHelices, 0, t, 0, rnaHelices.length); - j = rnaHelices.length; - rnaHelices = t; - } - else - { - return; - } - // Generate random colors and store - for (; j <= n; j++) - { - rnaHelices[j] = jalview.util.ColorUtils - .generateRandomColor(Color.white); - } - } /** * false if the scheme was constructed without a minColour and maxColour used * to decide if existing colours should be taken from annotation elements when @@ -171,7 +144,7 @@ public class AnnotationColourGradient extends FollowerColourScheme aamin = annotation.graphMin; if (annotation.isRNA()) { - initRnaHelicesShading(1 + (int) aamax); + ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax); } } @@ -220,7 +193,7 @@ public class AnnotationColourGradient extends FollowerColourScheme } if (rna) { - initRnaHelicesShading(1 + (int) aamax); + ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax); } } } @@ -285,7 +258,7 @@ public class AnnotationColourGradient extends FollowerColourScheme public Color findColour(char c, int j, SequenceI seq) { Color currentColour = Color.white; - AlignmentAnnotation annotation = (seqAssociated ? seqannot.get(seq) + AlignmentAnnotation annotation = (seqAssociated && seqannot!=null ? seqannot.get(seq) : this.annotation); if (annotation == null) { @@ -313,7 +286,8 @@ public class AnnotationColourGradient extends FollowerColourScheme || (annotationThreshold != null && (aboveAnnotationThreshold == ABOVE_THRESHOLD ? aj.value >= annotationThreshold.value : aj.value <= annotationThreshold.value))) { - if (predefinedColours && aj.colour != null) + if (predefinedColours && aj.colour != null + && !aj.colour.equals(Color.black)) { currentColour = aj.colour; } @@ -331,7 +305,7 @@ public class AnnotationColourGradient extends FollowerColourScheme { if (annotation.isRNA()) { - currentColour = rnaHelices[(int) aj.value]; + currentColour = ColourSchemeProperty.rnaHelices[(int) aj.value]; } else {