+ private void checkLimits()
+ {
+ aamax = annotation.graphMax;
+ aamin = annotation.graphMin;
+ if (annotation.isRNA())
+ {
+ // reset colour palette
+ ColourSchemeProperty.resetRnaHelicesShading();
+ ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
+ }
+ }
+
+ @Override
+ public void alignmentChanged(AnnotatedCollectionI alignment,
+ Map<SequenceI, SequenceCollectionI> hiddenReps)
+ {
+ super.alignmentChanged(alignment, hiddenReps);
+
+ if (seqAssociated && annotation.getCalcId() != null)
+ {
+ if (seqannot != null)
+ {
+ seqannot.clear();
+ }
+ else
+ {
+ seqannot = new IdentityHashMap<SequenceI, AlignmentAnnotation>();
+ }
+ // resolve the context containing all the annotation for the sequence
+ AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment
+ : alignment.getContext();
+ boolean f = true, rna = false;
+ for (AlignmentAnnotation alan : alcontext.findAnnotation(annotation
+ .getCalcId()))
+ {
+ if (alan.sequenceRef != null
+ && (alan.label != null && annotation != null && alan.label
+ .equals(annotation.label)))
+ {
+ if (!rna && alan.isRNA())
+ {
+ rna = true;
+ }
+ seqannot.put(alan.sequenceRef, alan);
+ if (f || alan.graphMax > aamax)
+ {
+ aamax = alan.graphMax;
+ }
+ if (f || alan.graphMin < aamin)
+ {
+ aamin = alan.graphMin;
+ }
+ f = false;
+ }
+ }
+ if (rna)
+ {
+ ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
+ }
+ }
+ }
+
+ float aamin = 0f, aamax = 0f;
+