From: amwaterhouse Date: Mon, 24 Jan 2005 17:27:00 +0000 (+0000) Subject: returns color.white if the underlying colourscheme is null X-Git-Tag: Release_2_0~728 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=d4ede6b61d4abab78200f334d8df07879dfe6741;p=jalview.git returns color.white if the underlying colourscheme is null --- diff --git a/src/jalview/schemes/ConservationColourScheme.java b/src/jalview/schemes/ConservationColourScheme.java index ab5a808..f6726bb 100755 --- a/src/jalview/schemes/ConservationColourScheme.java +++ b/src/jalview/schemes/ConservationColourScheme.java @@ -83,12 +83,9 @@ public class ConservationColourScheme extends ResidueColourScheme { int tmp = 10; int t = 0; - try - {t=Integer.parseInt(conserve.getConsSequence().getSequence().substring(i,i+1));} - catch(NumberFormatException ex){ - System.out.println("fix this bug, conserveColourScheme"); - t=0; - } + if( !jalview.util.Comparison.isGap( conserve.getConsSequence().getSequence().charAt(i) )) + t=Integer.parseInt(conserve.getConsSequence().getSequence().substring(i,i+1)); + c = findColour(null,s,i); while (tmp >= t) { @@ -105,7 +102,10 @@ public class ConservationColourScheme extends ResidueColourScheme { } public Color findColour(DrawableSequence seq, String s, int j) { - return cs.findColour( s, -1, null); + if(cs!=null) + return cs.findColour( s, -1, null); + else + return Color.white; } public boolean fullConservation(int j) { String tmp = conserve.getConsSequence().getSequence().substring(j,j+1);