JAL-1684 JAL-1452 new applet parameters defaultColourNuc
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 5 Oct 2015 11:00:23 +0000 (12:00 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 5 Oct 2015 11:00:23 +0000 (12:00 +0100)
defaultColourProt, used in split frame applet example

examples/appletParameters.html
examples/applets.html
src/jalview/appletgui/AlignViewport.java

index 8daa4ee..1e45aae 100644 (file)
@@ -118,6 +118,14 @@ the applet can be interacted with <em>via</em> its
             <td>Default is no colour.</td>
           </tr>
           <tr> 
+            <td>defaultColourNuc</td>
+            <td>A colour scheme (from the list above) to apply to Nucleotide alignments</td><td>This overrides defaultColour if it is specified.</td>
+          </tr>
+          <tr> 
+            <td>defaultColourProt</td>
+            <td>A colour scheme (from the list above) to apply to Peptide alignments</td><td>This overrides defaultColour if it is specified.</td>
+          </tr>
+          <tr> 
             <td>userDefinedColour</td>
             <td><p><em>Example:</em><br>
                 D,E=red; K,R,H=0022FF; c=yellow</p></td>
index d811e94..34118b8 100644 (file)
@@ -187,7 +187,8 @@ Try out JalviewLite by pressing one of the buttons below.<br/>
 <param name="windowWidth" value="800"/>
 <param name="showAnnotation" value="true"/>
 <param name="showSequenceLogo" value="true"/>
-<param name="defaultColour" value="Purine/Pyrimidine"/>
+<param name="defaultColourNuc" value="Purine/Pyrimidine"/>
+<param name="defaultColourProt" value="Clustal"/>
    <param name="APPLICATION_URL"
      value="http://www.jalview.org/services/launchApp"/>
 </applet>
index e434825..7ef2d59 100644 (file)
@@ -187,8 +187,13 @@ public class AlignViewport extends AlignmentViewport implements
 
     if (applet != null)
     {
-      String colour = applet.getParameter("defaultColour");
-
+      String colour = al.isNucleotide() ? applet
+              .getParameter("defaultColourNuc") : applet
+              .getParameter("defaultColourProt");
+      if (colour == null)
+      {
+        colour = applet.getParameter("defaultColour");
+      }
       if (colour == null)
       {
         colour = applet.getParameter("userDefinedColour");