1 package jalview.schemes;
\r
3 import jalview.datamodel.*;
\r
7 public class ResidueColourScheme implements ColourSchemeI{
\r
11 public ResidueColourScheme(Color[] colors, int threshold) {
\r
12 this.colors = colors;
\r
13 this.threshold = threshold;
\r
16 public ResidueColourScheme() {
\r
19 public Color findColour(String aa)
\r
21 return colors[((Integer)(ResidueProperties.aaHash.get(aa))).intValue()];
\r
24 public Color findColour(String s, int j, Vector aa) {
\r
26 if( threshold==0 || aboveThreshold(aa,s,j))
\r
27 return colors[((Integer)(ResidueProperties.aaHash.get(s))).intValue()];
\r
33 public int getThreshold() {
\r
37 public void setThreshold(int ct) {
\r
41 public boolean aboveThreshold(Vector aa,String s, int j)
\r
44 Hashtable hash = (Hashtable)aa.elementAt(j);
\r
46 if ( ( (Integer) hash.get("maxCount")).intValue() != -1 && hash.contains(s))
\r
48 //// resCount//////////////////// ///////////////seq count////////////
\r
49 double sc = ( (Integer) hash.get(s)).intValue() * 100.0 / ( (Integer) hash.get("size")).intValue();
\r
51 if (sc >= threshold)
\r
59 public boolean canThreshold() {
\r
62 public boolean isUserDefinable() {
\r