+ public RNAHelicesColour(AnnotatedCollectionI alignment)
+ {
+ super(ResidueProperties.nucleotideIndex);
+ ColourSchemeProperty.resetRnaHelicesShading();
+ alignmentChanged(alignment, null);
+ }
+
+ /**
+ * clones colour settings and annotation row data
+ *
+ * @param rnaHelicesColour
+ */
+ public RNAHelicesColour(RNAHelicesColour rnaHelicesColour)
+ {
+ super(ResidueProperties.nucleotideIndex);
+ annotation = rnaHelicesColour.annotation;
+ refresh();
+ }
+
+ @Override
+ public void alignmentChanged(AnnotatedCollectionI alignment,
+ Map<SequenceI, SequenceCollectionI> hiddenReps)
+ {
+
+ // This loop will find the first rna structure annotation by which to colour
+ // the sequences.
+ AlignmentAnnotation[] annotations = alignment.getAlignmentAnnotation();
+ if (annotations == null)
+ {
+ return;
+ }
+ for (int i = 0; i < annotations.length; i++)
+ {
+
+ // is this a sensible way of determining type of annotation?
+ if (annotations[i].visible && annotations[i].isRNA()
+ && annotations[i].isValidStruc())
+ {
+ annotation = annotations[i];
+ break;
+ }
+ }
+
+ refresh();
+
+ }
+