bugfix for transfer of user defined colourscheme from applet to application via jnlp...
authorjprocter <Jim Procter>
Tue, 4 Nov 2008 09:16:40 +0000 (09:16 +0000)
committerjprocter <Jim Procter>
Tue, 4 Nov 2008 09:16:40 +0000 (09:16 +0000)
src/jalview/schemes/ColourSchemeProperty.java

index 162ba46..6fc4e2b 100755 (executable)
@@ -311,16 +311,12 @@ public class ColourSchemeProperty
   }
 
   /**
-   * DOCUMENT ME!
+   * retrieve or create colourscheme associated with name
    * 
-   * @param seqs
-   *                DOCUMENT ME!
-   * @param width
-   *                DOCUMENT ME!
-   * @param name
-   *                DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
+   * @param seqs sequences to colour
+   * @param width range of sequences to colour
+   * @param name colourscheme name, applet colour parameter specification, or string to parse as colour for new coloursheme
+   * @return Valid Colourscheme
    */
   public static ColourSchemeI getColour(java.util.Vector seqs, int width,
           String name)
@@ -335,6 +331,16 @@ public class ColourSchemeProperty
       {
         // System.err.println("Ignoring unknown colourscheme name");
       }
+      try {
+        // fix the launchApp user defined coloursheme transfer bug
+        jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(
+                "white");
+        ucs.parseAppletParameter(name);
+
+      } catch (Exception e)
+      {
+        // System.err.println("Ignoring exception when parsing colourscheme as applet-parameter");
+      }
     }
     return getColour(seqs, width, getColourIndexFromName(name));
   }