Ensure 'None' translates into no colour scheme applied
authorjprocter <Jim Procter>
Mon, 11 Aug 2008 14:55:49 +0000 (14:55 +0000)
committerjprocter <Jim Procter>
Mon, 11 Aug 2008 14:55:49 +0000 (14:55 +0000)
src/jalview/schemes/ColourSchemeProperty.java

index ef2feac..2f81d13 100755 (executable)
@@ -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
       {