1 package jalview.schemes;
\r
3 import jalview.datamodel.*;
\r
4 import jalview.jbgui.*;
\r
9 public class PIDColourScheme extends ResidueColourScheme {
\r
10 public Color[] pidColours;
\r
11 public float[] thresholds;
\r
13 SequenceGroup group;
\r
15 public PIDColourScheme() {
\r
16 this.pidColours = ResidueProperties.pidColours;
\r
17 this.thresholds = ResidueProperties.pidThresholds;
\r
19 public Color getColour(SequenceI seq, int j,Vector aa) {
\r
20 Color c = Color.white;
\r
22 String s = seq.getSequence(j,j+1);
\r
24 if (aa != null && j < aa.size()) {
\r
25 c = findColour(seq,s,j,aa);
\r
31 public Color findColour(SequenceI seq,String s, int j,Vector aa) {
\r
32 Color c = Color.white;
\r
33 Hashtable hash = null;
\r
36 hash = (Hashtable)aa.elementAt(j);
\r
41 String max = (String)hash.get("maxResidue");
\r
44 if (((Integer)hash.get("maxCount")).intValue() != -1 && hash.contains(s)) {
\r
45 sc = ((Integer)hash.get(s)).intValue()*100.0/Integer.parseInt((String)hash.get("maxResidue"));
\r
47 // MC Should be isGap
\r
48 if ( !s.equals("-") && !s.equals(".") && !s.equals(" ")) {
\r
49 for (int i=0; i < thresholds.length; i++) {
\r
50 if (sc > thresholds[i]) {
\r