X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fschemes%2FRNAHelicesColour.java;h=33b275d7f192b74ca64f337961b2b694f1bcb35f;hb=156ab6ab1046c02dc327c2ac986afa336f0bbf3b;hp=aacf5579ff46de1af6b8a10e20066523b9aa1d99;hpb=94379c810f9115b8564ee7bac46ed119218d5fd2;p=jalview.git diff --git a/src/jalview/schemes/RNAHelicesColour.java b/src/jalview/schemes/RNAHelicesColour.java index aacf557..33b275d 100644 --- a/src/jalview/schemes/RNAHelicesColour.java +++ b/src/jalview/schemes/RNAHelicesColour.java @@ -20,6 +20,7 @@ */ package jalview.schemes; +import jalview.api.AlignViewportI; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.AnnotatedCollectionI; @@ -45,7 +46,7 @@ public class RNAHelicesColour extends ResidueColourScheme * Maps sequence positions to the RNA helix they belong to. Key: position, * Value: helix TODO: Revise or drop in favour of annotation position numbers */ - public Hashtable positionsToHelix = new Hashtable(); + public Hashtable positionsToHelix = new Hashtable<>(); /** * Number of helices in the RNA secondary structure @@ -125,14 +126,14 @@ public class RNAHelicesColour extends ResidueColourScheme 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(); numHelix = 0; - positionsToHelix = new Hashtable(); + positionsToHelix = new Hashtable<>(); // Figure out number of helices // Length of rnasecstr is the number of pairs of positions that base pair @@ -151,11 +152,11 @@ public class RNAHelicesColour extends ResidueColourScheme positionsToHelix.put(this.annotation._rnasecstr[x].getEnd(), this.annotation._rnasecstr[x].getFeatureGroup()); - if (Integer.parseInt(this.annotation._rnasecstr[x] - .getFeatureGroup()) > numHelix) + if (Integer.parseInt( + this.annotation._rnasecstr[x].getFeatureGroup()) > numHelix) { - numHelix = Integer.parseInt(this.annotation._rnasecstr[x] - .getFeatureGroup()); + numHelix = Integer.parseInt( + this.annotation._rnasecstr[x].getFeatureGroup()); } } @@ -206,8 +207,8 @@ public class RNAHelicesColour extends ResidueColourScheme } @Override - public ColourSchemeI getInstance(AnnotatedCollectionI sg, - Map hiddenRepSequences) + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI sg) { return new RNAHelicesColour(sg); } @@ -230,17 +231,8 @@ public class RNAHelicesColour extends ResidueColourScheme } /* - * check dataset + * not currently supporting this option for group annotation / colouring */ - AnnotatedCollectionI context = ac.getContext(); - if (context == null) - { - context = ac; - } - if (context instanceof AlignmentI) - { - return ((AlignmentI) context).hasRNAStructure(); - } return false; } @@ -249,4 +241,10 @@ public class RNAHelicesColour extends ResidueColourScheme { return JalviewColourScheme.RNAHelices.toString(); } + + @Override + public boolean isSimple() + { + return false; + } }