X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueColourScheme.java;h=7eab3dde3e2069ee86fc60ae08c3037b6694c9f8;hb=ac4bbf6dd2bfccdaae9067fb4765c73600dea729;hp=b0a5caa81f8f172cb75d9d326521c5cd65fb63a0;hpb=c300ec003b843d3166983a893effc1f4faafed08;p=jalview.git diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index b0a5caa..7eab3dd 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -7,13 +7,19 @@ import java.awt.*; public class ResidueColourScheme implements ColourSchemeI{ Color [] colors; int threshold = 0; + public Vector consensus; public ResidueColourScheme(Color[] colors, int threshold) { - this.colors = colors; + this.colors = colors; this.threshold = threshold; } - public ResidueColourScheme() { + public ResidueColourScheme() + { } + + public void setConsensus(Vector consensus) + { + this.consensus = consensus; } public Color findColour(String aa) @@ -21,9 +27,9 @@ public class ResidueColourScheme implements ColourSchemeI{ return colors[((Integer)(ResidueProperties.aaHash.get(aa))).intValue()]; } - public Color findColour(String s, int j, Vector aa) { + public Color findColour(String s, int j) { - if( threshold==0 || aboveThreshold(aa,s,j)) + if( threshold==0 || aboveThreshold(s,j)) return colors[((Integer)(ResidueProperties.aaHash.get(s))).intValue()]; else return Color.white; @@ -38,10 +44,9 @@ public class ResidueColourScheme implements ColourSchemeI{ threshold = ct; } - public boolean aboveThreshold(Vector aa,String s, int j) + public boolean aboveThreshold(String s, int j) { - - Hashtable hash = (Hashtable)aa.elementAt(j); + Hashtable hash = (Hashtable)consensus.elementAt(j); if ( ( (Integer) hash.get("maxCount")).intValue() != -1 && hash.contains(s)) {