No need for drawableSequence
authoramwaterhouse <Andrew Waterhouse>
Tue, 1 Feb 2005 18:59:47 +0000 (18:59 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 1 Feb 2005 18:59:47 +0000 (18:59 +0000)
src/jalview/schemes/ConservationColourScheme.java

index f6726bb..af52bda 100755 (executable)
@@ -34,92 +34,58 @@ public class ConservationColourScheme extends ResidueColourScheme {
     super();\r
     conserve = cons;\r
     cs = oldcs;\r
+\r
   }\r
 \r
-  public void setColours(DrawableSequence seq, int j) {\r
-    Color c = Color.white;\r
-    String s = seq.getSequence().substring(j,j+1);\r
 \r
-      if (colourThreshold > 0 && conserve.getConsSequence() != null) {\r
-        if (fullConservation(j)) {\r
-          if (byResidue) {\r
-            c = findColour(seq,s,j);\r
-           } else {\r
-             c = Color.red;\r
-           }\r
-        } else {\r
-          if (byResidue) {\r
-\r
-            int tmp = 10;\r
-            int t = Integer.parseInt(conserve.getConsSequence().getSequence().substring(j,j+1));\r
-            c = findColour(seq,s,j);\r
-\r
-             while (tmp >= t) {\r
-              //      c = c.darker();\r
-              c = lighter(c,inc);\r
-               tmp--;\r
-             }\r
-          } else {\r
-          c = Color.yellow;\r
-          }\r
-        }\r
-      }\r
-\r
-      seq.setColor(c);\r
-  }\r
    public Color findColour(String s, int i, java.util.Vector whatever)\r
    {\r
      Color c = null;\r
      if (colourThreshold > 0 && conserve.getConsSequence() != null)\r
      {\r
-       if (fullConservation(i)) {\r
-         if (byResidue) {\r
-           c = findColour(null,s,i);\r
-          } else {\r
-            c = Color.red;\r
-          }\r
-       } else {\r
-         if (byResidue) {\r
+       if (conserve.getConsSequence().getSequence().charAt(i)=='*')\r
+       {\r
+         if (byResidue)\r
+           c = findColour(s, i);\r
+         else\r
+           c = Color.red;\r
+       }\r
+       else\r
+       {\r
+         if (byResidue)\r
+         {\r
 \r
            int tmp = 10;\r
            int t = 0;\r
-           if( !jalview.util.Comparison.isGap( conserve.getConsSequence().getSequence().charAt(i) ))\r
-               t=Integer.parseInt(conserve.getConsSequence().getSequence().substring(i,i+1));\r
+           if (!jalview.util.Comparison.isGap(conserve.getConsSequence().\r
+                                              getSequence().charAt(i)))\r
+             t = Integer.parseInt(conserve.getConsSequence().getSequence().\r
+                                  substring(i, i + 1));\r
 \r
-           c = findColour(null,s,i);\r
+           c = findColour(s, i);\r
 \r
-            while (tmp >= t) {\r
+           while (tmp >= t)\r
+           {\r
              //      c = c.darker();\r
-             c = lighter(c,inc);\r
-              tmp--;\r
-            }\r
-         } else {\r
-         c = Color.yellow;\r
+             c = lighter(c, inc);\r
+             tmp--;\r
+           }\r
          }\r
+         else\r
+           c = Color.yellow;\r
        }\r
      }\r
      return c;\r
    }\r
 \r
-  public Color findColour(DrawableSequence seq, String s, int j) {\r
+  public Color findColour(String s, int j) {\r
     if(cs!=null)\r
-      return cs.findColour( s, -1, null);\r
+      return cs.findColour( s, j, null);\r
     else\r
       return Color.white;\r
   }\r
-  public boolean fullConservation(int j) {\r
-    String tmp = conserve.getConsSequence().getSequence().substring(j,j+1);\r
-    if (tmp.equals("*")) return true; else return false;\r
-  }\r
-  public boolean aboveThreshold(DrawableSequence seq, int j, int threshold) {\r
-    String tmp = conserve.getConsSequence().getSequence().substring(j,j+1);\r
-\r
-    if (Integer.parseInt(tmp) >= threshold || tmp.equals("*")) {\r
-      return true;\r
-    } else {\r
-      return false;\r
-    }\r
-  }\r
+\r
+\r
 \r
   public Color lighter(Color c, int inc) {\r
     int red = c.getRed();\r