package jalview.schemes; import jalview.datamodel.*; import java.util.*; import java.awt.*; public class PIDColourScheme extends ResidueColourScheme { public Color[] pidColours; public float[] thresholds; SequenceGroup group; public PIDColourScheme() { this.pidColours = ResidueProperties.pidColours; this.thresholds = ResidueProperties.pidThresholds; } public Color findColour(String s, int j,Vector aa) { Color c = Color.white; Hashtable hash = null; if (aa != null) hash = (Hashtable)aa.elementAt(j); else return c; String max = (String)hash.get("maxResidue"); double sc = 0; if ( Integer.parseInt( hash.get("maxCount").toString() ) != -1 && hash.contains(s)) { sc = ( (Integer) hash.get(s)).intValue() * 100.0 / ((Integer)hash.get("size")).intValue() ; // MC Should be isGap if (!jalview.util.Comparison.isGap((s.charAt(0)))) { for (int i = 0; i < thresholds.length; i++) { if (sc > thresholds[i]) { c = pidColours[i]; break; } } } } return c; } }