JAL-2360 ColourSchemes holds configured schemes, AlignFrame colour menu
[jalview.git] / src / jalview / schemes / ColourSchemeProperty.java
index cee2cae..53e9b60 100755 (executable)
@@ -78,10 +78,16 @@ public class ColourSchemeProperty
       return null;
 
     }
-    JalviewColourScheme scheme = JalviewColourScheme.forName(name);
+
+    /*
+     * if this is the name of a registered colour scheme, just
+     * create a new instance of it
+     */
+    ColourSchemeI scheme = ColourSchemes.getInstance().getColourScheme(
+            name, forData);
     if (scheme != null)
     {
-      return scheme.getColourScheme(forData);
+      return scheme;
     }
 
     /*
@@ -91,14 +97,7 @@ public class ColourSchemeProperty
      * e.g. "red" or "ff00ed",
      * or failing that hash the name to a colour
      */
-    UserColourScheme ucs = null;
-    try
-    {
-      ucs = new UserColourScheme(name);
-    } catch (Exception e)
-    {
-      // System.err.println("Ignoring exception when parsing colourscheme as applet-parameter");
-    }
+    UserColourScheme ucs = new UserColourScheme(name);
     return ucs;
   }