parseAppletParam
authoramwaterhouse <Andrew Waterhouse>
Wed, 14 Jun 2006 10:15:39 +0000 (10:15 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 14 Jun 2006 10:15:39 +0000 (10:15 +0000)
src/jalview/appletgui/AlignViewport.java

index 152966e..cd6515e 100755 (executable)
@@ -141,14 +141,34 @@ public class AlignViewport
     updateConservation();\r
     updateConsensus();\r
 \r
-    if (applet != null && applet.getParameter("defaultColour") != null)\r
+\r
+    if (applet != null)\r
     {\r
-      globalColourScheme = ColourSchemeProperty.getColour(alignment,\r
-          applet.getParameter("defaultColour"));\r
-      if (globalColourScheme != null)\r
+      String colour = applet.getParameter("defaultColour");\r
+\r
+      if(colour == null)\r
+      {\r
+        colour = applet.getParameter("userDefinedColour");\r
+        if(colour !=null)\r
+          colour = "User Defined";\r
+      }\r
+\r
+      if(colour != null)\r
+      {\r
+        globalColourScheme = ColourSchemeProperty.getColour(alignment, colour);\r
+        if (globalColourScheme != null)\r
+        {\r
+          globalColourScheme.setConsensus(vconsensus);\r
+        }\r
+      }\r
+\r
+      if(applet.getParameter("userDefinedColour")!=null)\r
       {\r
-        globalColourScheme.setConsensus(vconsensus);\r
+        ((UserColourScheme)globalColourScheme).parseAppletParameter(\r
+            applet.getParameter("userDefinedColour"));\r
       }\r
+\r
+\r
     }\r
   }\r
 \r