From 1efc6eee5c3eff789274b47a46707ba2d0923288 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 14 Apr 2005 16:52:43 +0000 Subject: [PATCH] blosum colour now displayed ok --- src/jalview/schemes/ConservationColourScheme.java | 35 ++++++--------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/src/jalview/schemes/ConservationColourScheme.java b/src/jalview/schemes/ConservationColourScheme.java index f8db803..cef65c2 100755 --- a/src/jalview/schemes/ConservationColourScheme.java +++ b/src/jalview/schemes/ConservationColourScheme.java @@ -24,7 +24,6 @@ import jalview.analysis.*; public class ConservationColourScheme extends ResidueColourScheme { public Conservation conserve; - boolean byResidue = true; public ColourSchemeI cs; public int inc = 30; int colourThreshold = 7; @@ -38,24 +37,21 @@ public class ConservationColourScheme extends ResidueColourScheme { } - public Color findColour(String s, int i, java.util.Vector whatever) + public Color findColour(String s, int i, java.util.Vector v) { - Color c = null; + Color c = Color.white; + if(cs == null) + return c; + if (colourThreshold > 0 && conserve.getConsSequence() != null) { - if (conserve.getConsSequence().getSequence().charAt(i)=='*' - || conserve.getConsSequence().getSequence().charAt(i)=='+') + if (conserve.getConsSequence().getSequence().charAt(i) == '*' + || conserve.getConsSequence().getSequence().charAt(i) == '+') { - if (byResidue) - c = findColour(s, i); - else - c = Color.red; + c = cs.findColour(s, i, v); } else { - if (byResidue) - { - int tmp = 10; int t = 0; if (!jalview.util.Comparison.isGap(conserve.getConsSequence(). @@ -63,30 +59,17 @@ public class ConservationColourScheme extends ResidueColourScheme { t = Integer.parseInt(conserve.getConsSequence().getSequence(). substring(i, i + 1)); - c = findColour(s, i); - + c = cs.findColour(s, i, v); while (tmp >= t) { - // c = c.darker(); c = lighter(c, inc); tmp--; } - } - else - c = Color.yellow; } } return c; } - public Color findColour(String s, int j) { - if(cs!=null) - return cs.findColour( s, j, null); - else - return Color.white; - } - - public Color lighter(Color c, int inc) { int red = c.getRed(); -- 1.7.10.2