From: jprocter Date: Mon, 11 Aug 2008 14:55:49 +0000 (+0000) Subject: Ensure 'None' translates into no colour scheme applied X-Git-Tag: Release_2_4~45 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7b999e54e654437cdd7d341bded0be02c10fc917;p=jalview.git Ensure 'None' translates into no colour scheme applied --- diff --git a/src/jalview/schemes/ColourSchemeProperty.java b/src/jalview/schemes/ColourSchemeProperty.java index ef2feac..2f81d13 100755 --- a/src/jalview/schemes/ColourSchemeProperty.java +++ b/src/jalview/schemes/ColourSchemeProperty.java @@ -67,8 +67,11 @@ public class ColourSchemeProperty /** DOCUMENT ME!! */ public static final int USER_DEFINED = 11; - /** DOCUMENT ME!! */ + /** No Colourscheme Index */ public static final int NONE = 12; + /** Undefined Colourscheme Index */ + public static final int UNDEFINED = 13; + /** * DOCUMENT ME! @@ -80,7 +83,7 @@ public class ColourSchemeProperty */ public static int getColourIndexFromName(String name) { - int ret = 12; + int ret = UNDEFINED; if (name.equalsIgnoreCase("Clustal")) { @@ -130,6 +133,10 @@ public class ColourSchemeProperty { ret = USER_DEFINED; } + else if (name.equalsIgnoreCase("None")) + { + ret = NONE; + } return ret; } @@ -145,7 +152,7 @@ public class ColourSchemeProperty public static String getColourName(ColourSchemeI cs) { - int index = 12; + int index = NONE; if (cs instanceof ClustalxColourScheme) { @@ -319,7 +326,7 @@ public class ColourSchemeProperty String name) { int colindex = getColourIndexFromName(name); - if (colindex > USER_DEFINED) + if (colindex == UNDEFINED) // USER_DEFINED) { try {