X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FBlosum62ColourScheme.java;h=6e91e0b2256677455e368362efb51ae48ca60cb3;hb=6f4eaccaaabb743c27589d4107439caeb490ac3e;hp=1aea477ea86b760920aaa888117c3b9f2a5fd339;hpb=efc31b4a8d5cee63555586804a2b79c06bdb5a14;p=jalview.git diff --git a/src/jalview/schemes/Blosum62ColourScheme.java b/src/jalview/schemes/Blosum62ColourScheme.java index 1aea477..6e91e0b 100755 --- a/src/jalview/schemes/Blosum62ColourScheme.java +++ b/src/jalview/schemes/Blosum62ColourScheme.java @@ -18,7 +18,6 @@ */ package jalview.schemes; -import java.util.*; import java.awt.*; @@ -32,20 +31,26 @@ public class Blosum62ColourScheme public Color findColour(String s, int j) { + char res = s.charAt(0); + if ('a' <= res && res <= 'z' ) + { + // TO UPPERCASE !!! + s = String.valueOf( res -= ('a' - 'A') ); + } + + if ( (threshold != 0) && !aboveThreshold(s, j)) { return Color.white; } - Hashtable hash = (Hashtable) consensus.elementAt(j); - - if (!jalview.util.Comparison.isGap( (s.charAt(0)))) + if (!jalview.util.Comparison.isGap( res )) { - String max = (String) hash.get("maxResidue"); + String max = (String) consensus[j].get("maxResidue"); if (max.indexOf(s) > -1) { - return new Color(154, 154, 255); + currentColour = new Color(154, 154, 255); } else { @@ -62,17 +67,22 @@ public class Blosum62ColourScheme if (c > 0) { - return new Color(204, 204, 255); + currentColour = new Color(204, 204, 255); } else { - return Color.white; + currentColour = Color.white; } } + + if(conservationColouring) + applyConservation(j); } else { return Color.white; } + + return currentColour; } }