private boolean seqAssociated = false;
IdentityHashMap<SequenceI, AlignmentAnnotation> seqannot = null;
+
@Override
public ColourSchemeI applyTo(AnnotatedCollectionI sg,
Map<SequenceI, SequenceCollectionI> 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;
acg.db = db;
acg.predefinedColours = predefinedColours;
acg.seqAssociated = seqAssociated;
-
+
return acg;
}
+
/**
* Creates a new AnnotationColourGradient object.
*/
seqannot = new IdentityHashMap<SequenceI, AlignmentAnnotation>();
}
// 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()))
{
}
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))
{
- if (predefinedColours)
+ if (annotation.annotations[j].colour != null)
{
- if (annotation.annotations[j].colour != null)
+ if (predefinedColours || annotation.hasIcons)
+ {
return annotation.annotations[j].colour;
- else
+ }
+ }
+ else
+ {
+ if (predefinedColours)
+ {
return currentColour;
+ }
}
-
if (aboveAnnotationThreshold == NO_THRESHOLD
|| (annotationThreshold != null
&& aboveAnnotationThreshold == ABOVE_THRESHOLD && annotation.annotations[j].value >= annotationThreshold.value)
{
currentColour = colourScheme.findColour(c, j, seq);
}
- else
+ else
{
dr = rr * range + r1;
dg = gg * range + g1;