Merge branch 'develop' into merge_JAL-2110
authorJim Procter <jprocter@issues.jalview.org>
Thu, 23 Jun 2016 13:58:42 +0000 (14:58 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 23 Jun 2016 13:58:42 +0000 (14:58 +0100)
17 files changed:
examples/appletDeployment.html
examples/applets.html
examples/embedded.html
examples/embeddedWJmol.html
examples/formComplete.html
examples/javascriptLaunch.html
examples/linkedapplets_ng.html
src/jalview/analysis/AlignmentUtils.java
src/jalview/gui/AlignFrame.java
src/jalview/io/AnnotationFile.java
src/jalview/io/JSONFile.java
src/jalview/schemes/FeatureColour.java
src/jalview/schemes/RNAHelicesColour.java
src/jalview/schemes/RNAHelicesColourChooser.java
src/jalview/viewmodel/AlignmentViewport.java
src/jalview/workers/StrucConsensusThread.java
test/jalview/schemes/FeatureColourTest.java

index 87953df..7fcca00 100644 (file)
 -->
 
 
-<div id="view_decorated" name="view_decorated"  style="margin:8px; padding:10px; border: 2px solid red; text-align:center; display:none;"><b>Click <a href="index.html#appletDeployment"> here</a> to view decorated page</b></div>
+<div id="view_decorated" name="view_decorated"  style="margin:8px; padding:10px; border: 2px solid red; text-align:center; display:none;"><b>Click <a href="index.html#appletDeployment"> here </a> to view decorated page</b></div>
 
 <!-- content start -->
-<h2><a name="appletDeployment"/>Notes on applet deployment</h2>
+<h2 name="appletDeployment"> Notes on applet deployment</h2>
 <table width=80% border="1">
   <tr><th colspan="2" align="center">Required Dependency Downloads</th></tr>
   <tr>
   </tr>
 </table>
 
-        <ul>
-          <li>Package all your data files into a single (or multiple) zip / jar 
-            files. This is very useful to reduce download time of large data files. 
-            The applet archive tag can take multiple entries separated by commas, 
-            eg<br>
-            <pre>&lt;applet code=&quot;jalview.bin.JalviewLite&quot;<em><strong> 
-            archive=&quot;jalviewApplet.jar, mydata.zip&quot;</strong></em>&gt;
-            </pre></li>
-          <li> Use Jalview for input to a HTML form. For an example of how to 
-            code this using Javascript, click <a href="javascript:doSubmit('formComplete')">here</a>. 
-            <br>
-          </li>
-          <li>Embed Jalview into the web page, without the &quot;Start Jalview&quot; 
-            button by setting the embed parameter to true;<br>
-            &lt;param name=&quot;embedded&quot;
-          value=&quot;true&quot;&gt; </li>
-       <li><a href="javascript:doSubmit('appletParameters')">View full list of supported parameters here.</a> </li>
-        </ul>
-        
-        <p><strong>**NEW FEATURES** in Jalview 2.9</strong></p> 
+<p>To run Jalview applet in your web page download the Jars listed above. The snippet below shows a minimal code for embedding Jalview applet into a web page.    
+<pre><code>
+&lt;applet code="jalview.bin.JalviewLite" width="756" height="560" archive="jalviewApplet.jar,JmolApplet-14.2.14_2015.06.11.jar,java-json.jar,json_simple-1.1.jar"&gt;
+       &lt;param name="permissions" value="sandbox" /&gt;
+       &lt;param name="file" value="plantfdx.fa" /&gt;
+       &lt;param name="features" value="plantfdx.features" /&gt;
+       &lt;param name="userDefinedColour" value="C=yellow; R,K,H=FF5555; D,E=5555FF" /&gt;
+       &lt;param name="showFullId" value="false" /&gt;
+       &lt;param name="embedded" value="true" /&gt;
+       &lt;param name="linkLabel_1" value="Uniprot" /&gt;
+       &lt;param name="linkUrl_1"      value="http://www.uniprot.org/uniprot/$SEQUENCE_ID$" /&gt;
+       &lt;param name="linkLabel_2" value="EMBL-EBI Search" /&gt;
+       &lt;param name="linkUrl_2"      value="http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$" /&gt;
+       &lt;param name="APPLICATION_URL" value="http://www.jalview.org/services/launchApp" /&gt;
+&lt;/applet&gt;
+</code></pre> 
+
+
+
+
+<ul>
+       <li>View full list of <a href="javascript:doSubmit('appletParameters')"> supported applet parameters here.</a></li>
+       <li>Package all your data files into a single (or multiple) zip /
+               jar files. This is very useful to reduce download time of large data
+               files. The applet archive tag can take multiple entries separated by
+               commas, eg<br> <pre>&lt;applet code=&quot;jalview.bin.JalviewLite&quot;<em><strong> archive=&quot;jalviewApplet.jar, mydata.zip&quot;</strong></em>&gt;
+            </pre>
+       </li>
+       <li>Use Jalview for input to a HTML form. For an example of how to
+               code this using Javascript, click <a
+               href="javascript:doSubmit('formComplete')">here</a>. <br>
+       </li>
+       <li>Embed Jalview into the web page, without the &quot;Start
+               Jalview&quot; button by setting the embed parameter to true;<br>
+               &lt;param name=&quot;embedded&quot; value=&quot;true&quot;&gt;
+       </li>
+       <li>For more examples, see the links to the left.</li>
+</ul>
+
+<table border="1" width=80%>
+       <tr><th colspan="2">Applet Release History</th>
+       <tr>
+               <th>Release</th>
+
+               <th>New Features / required changes</th>
+       </tr>
+       <tr>
+               <td><strong>2.9<br>(Latest)</strong></td>
+               <td>
         <ul>
         <li>Split Views for cDNA and Protein alignments<br/>Specify second alignment with 'file2' parameter, and set cDNA/Protein column scaling with scaleProteinAsCdna
         </li>
             <pre>archive=&quot;jalviewApplet.jar,JmolApplet-14.2.14_2015.06.11.jar,<font color="red">java-json.jar,json_simple-1.1.jar</font>&quot;</pre>              
        </li>
         </ul>
-        </p>
-        <p><strong>**NEW FEATURES** in Jalview 2.8</strong></p> 
-        <ul>
+               </td>
+       </tr>
+       <tr>
+               <td><strong>2.8</strong></td>
+               <td><ul>
         <li>Normalised sequence logo display
         </li>
         <li>RNA secondary structure annotation row
             original Jalview structure viewer will still be available. <br>
           </li>
           
-        </ul>
-        <p><strong>**NEW FEATURES** in Jalview 2.7</strong></p>
-        <ul>
+        </ul></td>
+       </tr>
+       <tr>
+               <td><strong>2.7</strong></td>
+               <td><ul>
         <li>Javascript callbacks capabilities<ul><li>oninit parameter and methods for registering javascript handlers for selections, mouseovers and linking to Jmol applets on the page.</li>
         <li>To use javascript callbacks, ensure the applet tag includes the '<a href="http://download.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html">mayscript</a>' attribute - either as a parameter (&lt;param name="mayscript" value="true"/;gt;) or as a bare attribute in the applet html tag).</li></ul>
         </li>
           the Jmol binary distribution available at the Jmol Sourceforge site, 
           or <a href="JmolApplet-12.1.13.jar">download the Jmol applet from here</a></li>
           <li>Minimum recommended version of Java runtime for the applet is now 1.5 (JalviewLite v2.6 without the Jmol viewer may work ok on earlier Java environments but compatibility can no-longer be guaranteed).</li>
-  </ul>
-        <br><strong>**NEW FEATURES** in Jalview 2.5</strong></p>
-        <ul>
-        <li>New parameters to control display of tree annotation, width of alignment columns, and to disable the jalview button and check for Jmol on startup.</li>
-  </ul>        
-        <br><strong>**NEW FEATURES** in Jalview 2.4</strong></p>
-        <ul>
+  </ul></td>
+       </tr>
+       <tr>
+               <td><strong>2.5</strong></td>
+               <td><ul>
+        <li>New parameters to control display of tree annotation, width of alignment columns, and to disable the jalview button and check for Jmol on startup.</li>  </ul>
+    </td>
+       </tr>
+       <tr>
+               <td><strong>2.4</strong></td>
+               <td><ul>
         <li>New applet API methods for feature display control, views, and obtaining current selection via javascript.</li>
           <li>Group show and hide parameters:
         &quot;showfeaturegroups&quot; and
         <li>&quot;debug&quot; parameter to control verbosity of the applet's console output.</li>
         <li>&quot;showbutton&quot; parameter to disable launch button and open JalviewLite immediatly.</li>
         <li>&quot;nojmol&quot; parameter to disable check for Jmol classes.</li>
-        </ul><br>
-        <strong>**NEW FEATURES** in Jalview 2.3</strong></p>
-        <ul>
+        </ul></td>
+       </tr>
+       <tr>
+               <td><strong>2.3</strong></td>
+               <td><ul>
           <li>Note that Parameter &quot;PDBFile&quot; now takes 
             the PDB file followed by a space separated list of alignment sequence 
             ids to associate the structure to. It is also possible to associate 
           <li>Note parameter &quot;PDBSeq&quot; is no longer required.<br>
           </li>
           <li>Jalview 2.3 was updated to work with Jmol 11. See the <a href="/development">versions archive if you want to download the old Jmol applet</a>.</li> 
-            <p>&nbsp;</p>
-          </li>
-        </ul>
-        <strong>**NEW FEATURES** in Jalview 2.1</strong> 
-        <ul>
+          
+        </ul></td>
+       </tr>
+       <tr>
+               <td><strong>2.1</strong></td>
+               <td><ul>
           <li>Jalview Applet can read and display JNet secondary structure annotation 
             directly via the <strong>jnetfile</strong> parameter. <br>
           </li>
             &lt;param name=&quot;sequence2&quot; value=&quot;FER1_PEA/14-29 TSFLRTQPMPMSVTTT&quot;&gt;<br>
             </pre>(All the usual Jalview File formats are valid, however each 
             new line in an alignment file must be entered as a parameter)</li>
-        </ul>
+        </ul></td>
+       </tr>
+</table>
+
+        
 <!-- content end -->
index 34118b8..1f65565 100644 (file)
 
 <!-- boiler plate link to alternate demopage -->
 <div style="width: 100%">
-<div style="width:35%; align:left; float:right;">
-<div style="margin:8px; padding:10px; border: 2px solid black; align: left;">
-<p>Quick Links to jars for example:<br/><a href="jalviewApplet.jar">jalviewApplet.jar</a> and <a href="JmolApplet-14.2.14_2015.06.11.jar">JmolApplet.jar</a>
-</p></div>
 </div>
-</div>
-
 <!-- content template start -->
 
 <p align="left">
 <h2>JalviewLite Button Examples</h2>
-Try out JalviewLite by pressing one of the buttons below.<br/>
- For more information on how to use the applet in your website, see the <a href="javascript:doSubmit('appletParameters')"><strong>applet parameters</strong></a> and other documentation in the links to the left.</p>
+Try out JalviewLite by pressing one of the buttons below. 
+  <a href="view-source:http://www.jalview.org/builds/develop/examples/applets.html" target="_blank">View the source for the examples below here</a> (If the link doesn't work on your browser try going to <a href="http://www.jalview.org/builds/develop/examples/applets.html">this page</a> and viewing the page source manually).<br/>
+ For more information on how to use the applet in your website, see the <a href="javascript:doSubmit('appletDeployment')"><strong>applet deployment,</strong></a> <a href="javascript:doSubmit('appletParameters')"><strong>applet parameters,</strong></a> and other documentation in the links to the left.</p>
 <p>&nbsp;</p><div align="center">
   <p align="center">
     <h2>Ferredoxins, chloroplast precursor related UniRef50
index aa67325..0d5ddf3 100644 (file)
@@ -23,9 +23,6 @@
 <!-- boiler plate link to alternate demopage -->
 <div style="width: 100%">
 <div style="width:35%; align:left; float:right;">
-<div style="margin:8px; padding:10px; border: 2px solid black; align: left;">
-<p>Quick Links to jars for example:<br/><a href="jalviewApplet.jar">jalviewApplet.jar</a> and <a href="JmolApplet-14.2.14_2015.06.11.jar">JmolApplet.jar</a>
-</p></div>
 </div>
 </div>
 
@@ -40,6 +37,7 @@
     <li><a href="plantfdx.annotations">plantfdx.annotations</a> -
       Jalview Alignment Annotations File</li>
   </ul>
+  <a href="view-source:http://www.jalview.org/builds/develop/examples/embedded.html" target="_blank">View the source code for this example here</a> (If the link doesn't work on your browser try going to <a href="http://www.jalview.org/builds/develop/examples/embedded.html">this page</a> and viewing the page source manually).<p>
   <applet
    code="jalview.bin.JalviewLite" width="756" height="560"
    archive="jalviewApplet.jar,JmolApplet-14.2.14_2015.06.11.jar,java-json.jar,json_simple-1.1.jar">
index f629312..1ecff58 100644 (file)
@@ -260,11 +260,7 @@ jmolInitialize("","JmolApplet-14.2.14_2015.06.11.jar");
   modeltofiles+="1gaq.txt";
 </script> 
 <div style="width: 100%">
-<div style="width:35%; align:left; float:right;">
-<div style="margin:8px; padding:10px; border: 2px solid black; align: left;">
-<p>Quick Links to jars for example:<br/><a href="jalviewApplet.jar">jalviewApplet.jar</a> and <a href="JmolApplet-14.2.14_2015.06.11.jar">JmolApplet.jar</a>
-</p></div>
-</div>
+
 </div>
 
 <!-- content template start -->
index 91d94f8..9e89990 100644 (file)
@@ -24,9 +24,7 @@
 <!-- boiler plate link to alternate demopage -->
 <div style="width: 100%">
 <div style="width:35%; align:left; float:right;">
-<div style="margin:8px; padding:10px; border: 2px solid black; align: left;">
-<p>Quick Links to jars for example:<br/><a href="jalviewApplet.jar">jalviewApplet.jar</a> and <a href="JmolApplet-14.2.14_2015.06.11.jar">JmolApplet.jar</a>
-</p></div>
+
 </div>
 </div>
 
@@ -35,7 +33,7 @@
 <p>Using the Javascript API to fill out forms using data from JalviewLite
 <br/>Click the Javascript buttons below to interact with the Applet
 instance on the page.</p>
-View the source in your browser to see how it has been done. <br/>
+  <a href="view-source:http://www.jalview.org/builds/develop/examples/formComplete.html" target="_blank">View the source here to see how it has been done</a>  (If the link doesn't work on your browser try going to <a href="http://www.jalview.org/builds/develop/examples/formComplete.html">this page</a> and viewing the page source manually).<br/>
 <a name="api">View the full <a href="javascript:doSubmit('jalviewLiteJs')">JalviewLite API documentation</a>.</a>
 <applet code="jalview.bin.JalviewLite" width="0" height="0"
        archive="jalviewApplet.jar,JmolApplet-14.2.14_2015.06.11.jar,java-json.jar,json_simple-1.1.jar" name="Jalview">
index e161ad6..35b1d81 100644 (file)
 
 <!-- boiler plate link to alternate demopage -->
 <div style="width: 100%">
-<div style="width:35%; align:left; float:right;">
 
-<div style="margin:8px; padding:10px; border: 2px solid black; align: left;">
-<p>Quick Links to jars for example:<br/><a href="jalviewApplet.jar">jalviewApplet.jar</a> and <a href="JmolApplet-14.2.14_2015.06.11.jar">JmolApplet.jar</a>
-</p></div>
-</div>
 </div>
 
 <!-- content template start -->
@@ -120,7 +115,7 @@ archive="jalviewApplet.jar,JmolApplet-14.2.14_2015.06.11.jar,java-json.jar,json_
 <param name="showbutton" value="false"/>
 </applet>
 
-<h2>Javascript Launch Button</h2><p>The button below demonstrates how JalviewLite can be launched via a javascript action.</p>
+<h2>Javascript Launch Button</h2><p>The button below demonstrates how JalviewLite can be launched via a javascript action.  <a href="view-source:http://www.jalview.org/builds/develop/examples/javascriptLaunch.html" target="_blank">View the source here to see how it has been done</a> (If the link doesn't work on your browser try going to <a href="http://www.jalview.org/builds/develop/examples/javascriptLaunch.html">this page</a> and viewing the page source manually). </p>
 
   <input type="button" name="Button1" value="Start"
 onClick="startJalview('plantfdx.fa','Button1.alignment','alwvar')"/>
index 0449c0b..5890515 100644 (file)
@@ -22,9 +22,7 @@
 <!-- boiler plate link to alternate demopage -->
 <div style="width: 100%">
 <div style="width:35%; align:left; float:right;">
-<div style="margin:8px; padding:10px; border: 2px solid black; align: left;">
-<p>Quick Links to jars for example:<br/><a href="jalviewApplet.jar">jalviewApplet.jar</a> and <a href="JmolApplet-14.2.14_2015.06.11.jar">JmolApplet.jar</a>
-</p></div>
+
 </div>
 </div>
 
@@ -36,7 +34,7 @@
 
     <h2>JalviewLite Linked Applets Demo</h2>
     <p>The two applets below use <a href="javascript:doSubmit('jalviewLiteJs')">JalviewLite's javascript API</a> to exchange events about the currently selected region and mouse position in the alignment.
-    </p>
+    <a href="view-source:http://www.jalview.org/builds/develop/examples/linkedapplets_ng.html" target="_blank">View the source here to see how it has been done</a>  (If the link doesn't work on your browser try going to <a href="http://www.jalview.org/builds/develop/examples/linkedapplets_ng.html">this page</a> and viewing the page source manually).</p>
 
 
 <applet
index 6a9dc7b..74066d7 100644 (file)
@@ -1333,15 +1333,19 @@ public class AlignmentUtils
           Collection<String> types, List<SequenceI> forSequences,
           boolean anyType, boolean doShow)
   {
-    for (AlignmentAnnotation aa : al.getAlignmentAnnotation())
+    AlignmentAnnotation[] anns = al.getAlignmentAnnotation();
+    if (anns != null)
     {
-      if (anyType || types.contains(aa.label))
+      for (AlignmentAnnotation aa : anns)
       {
-        if ((aa.sequenceRef != null)
-                && (forSequences == null || forSequences
-                        .contains(aa.sequenceRef)))
+        if (anyType || types.contains(aa.label))
         {
-          aa.visible = doShow;
+          if ((aa.sequenceRef != null)
+                  && (forSequences == null || forSequences
+                          .contains(aa.sequenceRef)))
+          {
+            aa.visible = doShow;
+          }
         }
       }
     }
index c5fb11f..54b1cb6 100644 (file)
@@ -5950,8 +5950,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   protected void setAnnotationsVisibility(boolean visible,
           boolean forSequences, boolean forAlignment)
   {
-    for (AlignmentAnnotation aa : alignPanel.getAlignment()
-            .getAlignmentAnnotation())
+    AlignmentAnnotation[] anns = alignPanel.getAlignment()
+            .getAlignmentAnnotation();
+    if (anns == null)
+    {
+      return;
+    }
+    for (AlignmentAnnotation aa : anns)
     {
       /*
        * don't display non-positional annotations on an alignment
index 8b3aa98..d738882 100755 (executable)
@@ -1760,6 +1760,10 @@ public class AnnotationFile
    */
   public String printCSVAnnotations(AlignmentAnnotation[] annotations)
   {
+    if (annotations == null)
+    {
+      return "";
+    }
     StringBuffer sp = new StringBuffer();
     for (int i = 0; i < annotations.length; i++)
     {
index 36980f8..3cda444 100644 (file)
@@ -744,11 +744,14 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
     fr = avpanel.cloneFeatureRenderer();
 
     // Add non auto calculated annotation to AlignFile
-    for (AlignmentAnnotation annot : annots)
+    if (annots != null)
     {
-      if (annot != null && !annot.autoCalculated)
+      for (AlignmentAnnotation annot : annots)
       {
-        annotations.add(annot);
+        if (annot != null && !annot.autoCalculated)
+        {
+          annotations.add(annot);
+        }
       }
     }
     globalColourScheme = ColourSchemeProperty.getColourName(viewport
index 213868b..bdc70c9 100644 (file)
@@ -317,6 +317,7 @@ public class FeatureColour implements FeatureColourI
    */
   public FeatureColour(FeatureColour fc)
   {
+    graduatedColour = fc.graduatedColour;
     colour = fc.colour;
     minColour = fc.minColour;
     maxColour = fc.maxColour;
index d17f510..9729a83 100644 (file)
@@ -91,6 +91,10 @@ public class RNAHelicesColour extends ResidueColourScheme
     // This loop will find the first rna structure annotation by which to colour
     // the sequences.
     AlignmentAnnotation[] annotations = alignment.getAlignmentAnnotation();
+    if (annotations == null)
+    {
+      return;
+    }
     for (int i = 0; i < annotations.length; i++)
     {
 
index 1a13bbe..b1b3c5a 100644 (file)
@@ -22,6 +22,7 @@ package jalview.schemes;
 
 import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
+import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.SequenceGroup;
 
 import java.awt.event.ActionEvent;
@@ -77,16 +78,20 @@ public class RNAHelicesColourChooser
     adjusting = true;
     Vector list = new Vector();
     int index = 1;
-    for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
+    AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation();
+    if (anns != null)
     {
-      String label = av.getAlignment().getAlignmentAnnotation()[i].label;
-      if (!list.contains(label))
+      for (int i = 0; i < anns.length; i++)
       {
-        list.addElement(label);
-      }
-      else
-      {
-        list.addElement(label + "_" + (index++));
+        String label = anns[i].label;
+        if (!list.contains(label))
+        {
+          list.addElement(label);
+        }
+        else
+        {
+          list.addElement(label + "_" + (index++));
+        }
       }
     }
 
index 0f6d66b..91ee3c1 100644 (file)
@@ -1420,11 +1420,15 @@ public abstract class AlignmentViewport implements AlignViewportI,
   protected void setSequenceAnnotationsVisible(SequenceI sequenceI,
           boolean visible)
   {
-    for (AlignmentAnnotation ann : alignment.getAlignmentAnnotation())
+    AlignmentAnnotation[] anns = alignment.getAlignmentAnnotation();
+    if (anns != null)
     {
-      if (ann.sequenceRef == sequenceI)
+      for (AlignmentAnnotation ann : anns)
       {
-        ann.visible = visible;
+        if (ann.sequenceRef == sequenceI)
+        {
+          ann.visible = visible;
+        }
       }
     }
   }
index 3483dac..4249112 100644 (file)
@@ -94,12 +94,15 @@ public class StrucConsensusThread extends AlignCalcWorker
               .getAlignmentAnnotation();
       AlignmentAnnotation rnaStruc = null;
       // select rna struct to use for calculation
-      for (int i = 0; i < aa.length; i++)
+      if (aa != null)
       {
-        if (aa[i].visible && aa[i].isRNA() && aa[i].isValidStruc())
+        for (int i = 0; i < aa.length; i++)
         {
-          rnaStruc = aa[i];
-          break;
+          if (aa[i].visible && aa[i].isRNA() && aa[i].isValidStruc())
+          {
+            rnaStruc = aa[i];
+            break;
+          }
         }
       }
       // check to see if its valid
index 9b1bd73..e13f542 100644 (file)
@@ -15,6 +15,44 @@ import org.testng.annotations.Test;
 public class FeatureColourTest
 {
   @Test(groups = { "Functional" })
+  public void testCopyConstructor()
+  {
+    /*
+     * plain colour
+     */
+    FeatureColour fc = new FeatureColour(Color.RED);
+    FeatureColour fc1 = new FeatureColour(fc);
+    assertTrue(fc1.getColour().equals(Color.RED));
+    assertFalse(fc1.isGraduatedColour());
+    assertFalse(fc1.isColourByLabel());
+
+    /*
+     * min-max colour
+     */
+    fc = new FeatureColour(Color.gray, Color.black, 10f, 20f);
+    fc.setAboveThreshold(true);
+    fc.setThreshold(12f);
+    fc1 = new FeatureColour(fc);
+    assertTrue(fc1.isGraduatedColour());
+    assertFalse(fc1.isColourByLabel());
+    assertTrue(fc1.isAboveThreshold());
+    assertEquals(12f, fc1.getThreshold());
+    assertEquals(Color.gray, fc1.getMinColour());
+    assertEquals(Color.black, fc1.getMaxColour());
+    assertEquals(10f, fc1.getMin());
+    assertEquals(20f, fc1.getMax());
+
+    /*
+     * colour by label
+     */
+    fc = new FeatureColour();
+    fc.setColourByLabel(true);
+    fc1 = new FeatureColour(fc);
+    assertTrue(fc1.isColourByLabel());
+    assertFalse(fc1.isGraduatedColour());
+  }
+
+  @Test(groups = { "Functional" })
   public void testIsColored_simpleColour()
   {
     FeatureColour fc = new FeatureColour(Color.RED);
@@ -297,5 +335,10 @@ public class FeatureColourTest
     assertEquals(Color.GREEN, fc.getMaxColour());
     assertEquals(10f, fc.getMin());
     assertEquals(20f, fc.getMax());
+
+    descriptor = String
+            .format("blue|255,0,255|absolute|20.0|95.0|below|66.0");
+    fc = FeatureColour.parseJalviewFeatureColour(descriptor);
+    assertTrue(fc.isGraduatedColour());
   }
 }