X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FAnnotationColourGradient.java;h=1a3e9efe49a8b0b105afc08aaefdb55f1c3b51d0;hb=517dab88dfe59707fe225eac761d3c46719a72eb;hp=fb1443dbf160da7cc942fb6549fe55eaf70824a4;hpb=f831ddf7f52d6c4a1918e87d94877b22bd322648;p=jalview.git diff --git a/src/jalview/schemes/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index fb1443d..1a3e9ef 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -68,7 +68,7 @@ public class AnnotationColourGradient extends FollowerColourScheme Map hiddenRepSequences) { AnnotationColourGradient acg = new AnnotationColourGradient(annotation, - colourScheme, aboveAnnotationThreshold); + getColourScheme(), aboveAnnotationThreshold); acg.thresholdIsMinMax = thresholdIsMinMax; acg.annotationThreshold = (annotationThreshold == null) ? null : new GraphLine(annotationThreshold); @@ -92,11 +92,12 @@ public class AnnotationColourGradient extends FollowerColourScheme { if (originalColour instanceof AnnotationColourGradient) { - colourScheme = ((AnnotationColourGradient) originalColour).colourScheme; + setColourScheme(((AnnotationColourGradient) originalColour) + .getColourScheme()); } else { - colourScheme = originalColour; + setColourScheme(originalColour); } this.annotation = annotation; @@ -276,88 +277,89 @@ public class AnnotationColourGradient extends FollowerColourScheme { return currentColour; } - if ((threshold == 0) || aboveThreshold(c, j)) + // if ((threshold == 0) || aboveThreshold(c, j)) + // { + if (annotation.annotations != null && j < annotation.annotations.length + && annotation.annotations[j] != null + && !jalview.util.Comparison.isGap(c)) { - if (annotation.annotations != null - && j < annotation.annotations.length - && annotation.annotations[j] != null - && !jalview.util.Comparison.isGap(c)) + Annotation aj = annotation.annotations[j]; + // 'use original colours' => colourScheme != null + // -> look up colour to be used + // predefined colours => preconfigured shading + // -> only use original colours reference if thresholding enabled & + // minmax exists + // annotation.hasIcons => null or black colours replaced with glyph + // colours + // -> reuse original colours if present + // -> if thresholding enabled then return colour on non-whitespace glyph + + if (aboveAnnotationThreshold == NO_THRESHOLD + || (annotationThreshold != null && (aboveAnnotationThreshold == ABOVE_THRESHOLD ? aj.value >= annotationThreshold.value + : aj.value <= annotationThreshold.value))) { - Annotation aj = annotation.annotations[j]; - // 'use original colours' => colourScheme != null - // -> look up colour to be used - // predefined colours => preconfigured shading - // -> only use original colours reference if thresholding enabled & - // minmax exists - // annotation.hasIcons => null or black colours replaced with glyph - // colours - // -> reuse original colours if present - // -> if thresholding enabled then return colour on non-whitespace glyph - - if (aboveAnnotationThreshold == NO_THRESHOLD - || (annotationThreshold != null && (aboveAnnotationThreshold == ABOVE_THRESHOLD ? aj.value >= annotationThreshold.value - : aj.value <= annotationThreshold.value))) + if (predefinedColours && aj.colour != null + && !aj.colour.equals(Color.black)) { - if (predefinedColours && aj.colour != null - && !aj.colour.equals(Color.black)) - { - currentColour = aj.colour; - } - else if (annotation.hasIcons - && annotation.graph == AlignmentAnnotation.NO_GRAPH) + currentColour = aj.colour; + } + else if (annotation.hasIcons + && annotation.graph == AlignmentAnnotation.NO_GRAPH) + { + if (aj.secondaryStructure > ' ' && aj.secondaryStructure != '.' + && aj.secondaryStructure != '-') { - if (aj.secondaryStructure > ' ' && aj.secondaryStructure != '.' - && aj.secondaryStructure != '-') + if (getColourScheme() != null) + { + currentColour = getColourScheme().findColour(c, j, seq, null, + 0f); + } + else { - if (colourScheme != null) + if (annotation.isRNA()) { - currentColour = colourScheme.findColour(c, j, seq); + currentColour = ColourSchemeProperty.rnaHelices[(int) aj.value]; } else { - if (annotation.isRNA()) - { - currentColour = ColourSchemeProperty.rnaHelices[(int) aj.value]; - } - else - { - currentColour = annotation.annotations[j].secondaryStructure == 'H' ? jalview.renderer.AnnotationRenderer.HELIX_COLOUR - : annotation.annotations[j].secondaryStructure == 'E' ? jalview.renderer.AnnotationRenderer.SHEET_COLOUR - : jalview.renderer.AnnotationRenderer.STEM_COLOUR; - } + currentColour = annotation.annotations[j].secondaryStructure == 'H' ? jalview.renderer.AnnotationRenderer.HELIX_COLOUR + : annotation.annotations[j].secondaryStructure == 'E' ? jalview.renderer.AnnotationRenderer.SHEET_COLOUR + : jalview.renderer.AnnotationRenderer.STEM_COLOUR; } } - else - { - // - return Color.white; - } } - else if (noGradient) + else { - if (colourScheme != null) - { - currentColour = colourScheme.findColour(c, j, seq); - } - else - { - if (aj.colour != null) - { - currentColour = aj.colour; - } - } + // + return Color.white; + } + } + else if (noGradient) + { + if (getColourScheme() != null) + { + currentColour = getColourScheme().findColour(c, j, seq, null, + 0f); } else { - currentColour = shadeCalculation(annotation, j); + if (aj.colour != null) + { + currentColour = aj.colour; + } } } - if (conservationColouring) + else { - currentColour = applyConservation(currentColour, j); + currentColour = shadeCalculation(annotation, j); } } + // if (conservationColouring) + // { + // currentColour = applyConservation(currentColour, j); + // } } + // } return currentColour; }