X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fschemes%2FRNAHelicesColour.java;h=152ad9a333088907d9b450bc20e2dbae03c0ca36;hb=1f491c8c9e66b3accb8bb9eae78c7d9caa63c1ac;hp=46fa626882f61e7ae050fb1955f6cb0295512d7e;hpb=47168f025aefdaa044802bd5f8f510ffe43a4808;p=jalview.git diff --git a/src/jalview/schemes/RNAHelicesColour.java b/src/jalview/schemes/RNAHelicesColour.java index 46fa626..152ad9a 100644 --- a/src/jalview/schemes/RNAHelicesColour.java +++ b/src/jalview/schemes/RNAHelicesColour.java @@ -67,6 +67,7 @@ public class RNAHelicesColour extends ResidueColourScheme this.annotation = annotation; refresh(); } + public RNAHelicesColour(AnnotatedCollectionI alignment) { super(ResidueProperties.nucleotideIndex); @@ -79,28 +80,31 @@ public class RNAHelicesColour extends ResidueColourScheme { // This loop will find the first rna structure annotation by which to colour - // the sequences. + // the sequences. AlignmentAnnotation[] annotations = alignment.getAlignmentAnnotation(); - for (int i = 0; i < annotations.length; i++) { - - // is this a sensible way of determining type of annotation? - if (annotations[i].getRNAStruc() != null) { - annotation = annotations[i]; - break; - } + for (int i = 0; i < annotations.length; i++) + { + + // is this a sensible way of determining type of annotation? + if (annotations[i].getRNAStruc() != null) + { + annotation = annotations[i]; + break; + } } refresh(); } + private long lastrefresh = -1; public void refresh() { - - if (annotation!=null && ((annotation._rnasecstr == null - || lastrefresh != annotation._rnasecstr.hashCode()) - && annotation.isValidStruc())) + + if (annotation != null + && ((annotation._rnasecstr == null || lastrefresh != annotation._rnasecstr + .hashCode()) && annotation.isValidStruc())) { annotation.getRNAStruc(); lastrefresh = annotation._rnasecstr.hashCode();