X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FRNAHelicesColour.java;h=c61eeed8bab6bad6ddd10b1137b258a0c3bb0df8;hb=6ef963034788a3499e25c1bbd8ccf850e18b3f94;hp=056a1676a4801cebe663a150a07e60437ce94af1;hpb=136c0793b90b72b928c4d77dc109dd5c644e00d3;p=jalview.git diff --git a/src/jalview/schemes/RNAHelicesColour.java b/src/jalview/schemes/RNAHelicesColour.java index 056a167..c61eeed 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 @@ -69,14 +70,14 @@ public class RNAHelicesColour extends ResidueColourScheme { super(ResidueProperties.nucleotideIndex); this.annotation = annotation; - ColourSchemeProperty.resetRnaHelicesShading(); + ColourSchemes.resetRnaHelicesShading(); refresh(); } public RNAHelicesColour(AnnotatedCollectionI alignment) { super(ResidueProperties.nucleotideIndex); - ColourSchemeProperty.resetRnaHelicesShading(); + ColourSchemes.resetRnaHelicesShading(); alignmentChanged(alignment, null); } @@ -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,15 +152,15 @@ 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()); } } - ColourSchemeProperty.initRnaHelicesShading(numHelix); + ColourSchemes.initRnaHelicesShading(numHelix); } } @@ -199,15 +200,15 @@ public class RNAHelicesColour extends ResidueColourScheme currentHelix = positionsToHelix.get(j); if (currentHelix != null) { - currentColour = ColourSchemeProperty.rnaHelices[Integer + currentColour = ColourSchemes.getInstance().rnaHelices[Integer .parseInt(currentHelix)]; } return currentColour; } @Override - public ColourSchemeI getInstance(AnnotatedCollectionI sg, - Map hiddenRepSequences) + public ColourSchemeI getInstance(AlignViewportI view, + AnnotatedCollectionI sg) { return new RNAHelicesColour(sg); }