From 7b999e54e654437cdd7d341bded0be02c10fc917 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 11 Aug 2008 14:55:49 +0000 Subject: [PATCH] Ensure 'None' translates into no colour scheme applied --- src/jalview/schemes/ColourSchemeProperty.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 { -- 1.7.10.2