X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FScoreColourScheme.java;h=225f8dd467280f7658a395c8a1d3a2486fb74619;hb=b78278b3ee2cb653c439fa207b78a469d53ce697;hp=89e94fde391669525c0cbfc00a5c471ec34b3476;hpb=df7fd106ef48a8c4cb515785d9d82e711b530aa0;p=jalview.git diff --git a/src/jalview/schemes/ScoreColourScheme.java b/src/jalview/schemes/ScoreColourScheme.java index 89e94fd..225f8dd 100755 --- a/src/jalview/schemes/ScoreColourScheme.java +++ b/src/jalview/schemes/ScoreColourScheme.java @@ -22,35 +22,27 @@ public class ScoreColourScheme extends ResidueColourScheme { this.max = max; } - /* public Color getColour(SequenceI seq, int j, Vector aa) { - Color c = Color.white; - String s = seq.getSequence(j,j+1); + + public Color findColour(String s,int j,Vector aa) + { if (threshold > 0) { - if (aboveThreshold(aa,seq,j,threshold)) - c = findColour(seq,s,j,aa); + if (!aboveThreshold(aa,s,j)) + return Color.white; } - else if ( !s.equals("-") && !s.equals(".") && !s.equals(" ") ) - c = findColour(seq,s,j,aa); - // else - // c = Color.white; - - return c; - }*/ - - public Color findColour(SequenceI seq,String s,int j,Vector aa) - { float red = (float)(scores[((Integer)ResidueProperties.aaHash.get(s)).intValue()] - (float)min)/(float)(max - min); - if (red > (float)1.0) - red = (float)1.0; + if (red > 1.0f) + red = 1.0f; + + if (red < 0.0f) + red = 0.0f; - if (red < (float)0.0) - red = (float)0.0; + char c = s.charAt(0); - if(s.equals(" ")|| s.equals(".") || s.equals("-")) + if(jalview.util.Comparison.isGap((c))) return Color.white; // This isn';t great - pool of colours in here?