X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueColourScheme.java;h=9c10e7d8e1101c95b193233ff6c60c781de3b020;hb=b8d09897dacc7b0ad203982b4578e2c1d8929142;hp=a688593eafc3f2f9ddb5e4f6908b52f6c7868541;hpb=588042b69abf8e60bcc950b24c283933c7dd422f;p=jalview.git diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index a688593..9c10e7d 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -23,53 +23,122 @@ import java.awt.*; import java.util.*; -public class ResidueColourScheme implements ColourSchemeI { +/** + * DOCUMENT ME! + * + * @author $author$ + * @version $Revision$ + */ +public class ResidueColourScheme implements ColourSchemeI +{ Color[] colors; int threshold = 0; + + /** DOCUMENT ME!! */ public Vector consensus; - public ResidueColourScheme(Color[] colors, int threshold) { + /** + * Creates a new ResidueColourScheme object. + * + * @param colors DOCUMENT ME! + * @param threshold DOCUMENT ME! + */ + public ResidueColourScheme(Color[] colors, int threshold) + { this.colors = colors; this.threshold = threshold; } - public ResidueColourScheme() { + /** + * Creates a new ResidueColourScheme object. + */ + public ResidueColourScheme() + { } - public void setConsensus(Vector consensus) { + /** + * DOCUMENT ME! + * + * @param consensus DOCUMENT ME! + */ + public void setConsensus(Vector consensus) + { this.consensus = consensus; } - public Color findColour(String aa) { + /** + * DOCUMENT ME! + * + * @param aa DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public Color findColour(String aa) + { return colors[((Integer) (ResidueProperties.aaHash.get(aa))).intValue()]; } - public Color findColour(String s, int j) { - if ((threshold == 0) || aboveThreshold(s, j)) { + /** + * DOCUMENT ME! + * + * @param s DOCUMENT ME! + * @param j DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public Color findColour(String s, int j) + { + if ((threshold == 0) || aboveThreshold(s, j)) + { return colors[((Integer) (ResidueProperties.aaHash.get(s))).intValue()]; - } else { + } + else + { return Color.white; } } - public int getThreshold() { + /** + * DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public int getThreshold() + { return threshold; } - public void setThreshold(int ct) { + /** + * DOCUMENT ME! + * + * @param ct DOCUMENT ME! + */ + public void setThreshold(int ct) + { threshold = ct; } - public boolean aboveThreshold(String s, int j) { + /** + * DOCUMENT ME! + * + * @param s DOCUMENT ME! + * @param j DOCUMENT ME! + * + * @return DOCUMENT ME! + */ + public boolean aboveThreshold(String s, int j) + { Hashtable hash = (Hashtable) consensus.elementAt(j); if ((((Integer) hash.get("maxCount")).intValue() != -1) && - hash.contains(s)) { + hash.contains(s)) + { //// resCount//////////////////// ///////////////seq count//////////// double sc = (((Integer) hash.get(s)).intValue() * 100.0) / ((Integer) hash.get( "size")).intValue(); - if (sc >= threshold) { + if (sc >= threshold) + { return true; } }