returns color.white if the underlying colourscheme is null
authoramwaterhouse <Andrew Waterhouse>
Mon, 24 Jan 2005 17:27:00 +0000 (17:27 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 24 Jan 2005 17:27:00 +0000 (17:27 +0000)
src/jalview/schemes/ConservationColourScheme.java

index ab5a808..f6726bb 100755 (executable)
@@ -83,12 +83,9 @@ public class ConservationColourScheme extends ResidueColourScheme {
 \r
            int tmp = 10;\r
            int t = 0;\r
-           try\r
-             {t=Integer.parseInt(conserve.getConsSequence().getSequence().substring(i,i+1));}\r
-             catch(NumberFormatException ex){\r
-               System.out.println("fix this bug, conserveColourScheme");\r
-               t=0;\r
-             }\r
+           if( !jalview.util.Comparison.isGap( conserve.getConsSequence().getSequence().charAt(i) ))\r
+               t=Integer.parseInt(conserve.getConsSequence().getSequence().substring(i,i+1));\r
+\r
            c = findColour(null,s,i);\r
 \r
             while (tmp >= t) {\r
@@ -105,7 +102,10 @@ public class ConservationColourScheme extends ResidueColourScheme {
    }\r
 \r
   public Color findColour(DrawableSequence seq, String s, int j) {\r
-    return cs.findColour( s, -1, null);\r
+    if(cs!=null)\r
+      return cs.findColour( s, -1, 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