Merge branch 'develop' into Release_2_9_0b1_Branch
authorJim Procter <jprocter@issues.jalview.org>
Thu, 8 Oct 2015 11:09:47 +0000 (12:09 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 8 Oct 2015 11:09:47 +0000 (12:09 +0100)
36 files changed:
.settings/org.eclipse.jdt.ui.prefs
help/html/features/groovy.html
help/html/releases.html
help/html/whatsNew.html
src/jalview/analysis/AlignmentUtils.java
src/jalview/appletgui/AlignFrame.java
src/jalview/bin/Jalview.java
src/jalview/bin/JalviewLite.java
src/jalview/datamodel/AlignmentAnnotation.java
src/jalview/datamodel/Mapping.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/Desktop.java
src/jalview/io/BioJsHTMLOutput.java
src/jalview/io/FeaturesFile.java
src/jalview/io/JSONFile.java
src/jalview/javascript/MouseOverStructureListener.java
src/jalview/jbgui/GStructureChooser.java
src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java
src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java [new file with mode: 0644]
src/jalview/json/binding/biojson/v1/AnnotationPojo.java
src/jalview/json/binding/biojson/v1/ColourSchemeMapper.java
src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java
src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java
src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java
src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java
src/jalview/schemes/UserColourScheme.java
src/jalview/util/HttpUtils.java
src/jalview/ws/DBRefFetcher.java
src/jalview/ws/uimodel/AlignAnalysisUIText.java
test/jalview/analysis/ParsePropertiesTest.java
test/jalview/bin/JalviewLiteTest.java
test/jalview/io/FeaturesFileTest.java
test/jalview/io/JSONFileTest.java
test/jalview/util/MappingUtilsTest.java
test/jalview/util/ParseHtmlBodyAndLinksTest.java
utils/JettyExamplesDir.java

index 5b61305..30e76be 100644 (file)
@@ -12,7 +12,7 @@ sp_cleanup.add_missing_annotations=true
 sp_cleanup.add_missing_deprecated_annotations=true
 sp_cleanup.add_missing_methods=false
 sp_cleanup.add_missing_nls_tags=false
-sp_cleanup.add_missing_override_annotations=false
+sp_cleanup.add_missing_override_annotations=true
 sp_cleanup.add_missing_override_annotations_interface_methods=true
 sp_cleanup.add_serial_version_id=false
 sp_cleanup.always_use_blocks=true
index bdaeab6..afb9098 100644 (file)
@@ -73,7 +73,7 @@
     There is as yet no properly defined scripting interface to Jalview,
     but all the public methods of the jalview class hierarchy can be
     called from Groovy scripts. The access point for this is the <strong>Jalview</strong>
-    object defined in the groovy environent which corresponds to the
+    object defined in the groovy environment which corresponds to the
   <pre>jalview.gui.Desktop</pre>
   object which manages all the Jalview windows. Here's an example to get
   you started:
index 6f4f159..76b536e 100755 (executable)
@@ -48,7 +48,7 @@
       <td width="60" nowrap>
         <div align="center">
           <strong><a name="Jalview.2.9.0b1">2.9.0b1</a><br />
-            <em>6/10/2015</em></strong>
+            <em>8/10/2015</em></strong>
         </div>
       </td>
       <td>
@@ -58,7 +58,8 @@
       </ul>
       <em>Application</em><ul>
       <!-- <li>cDNA/Protein splitframe window geometry preserved in Jalview projects</li>-->
-      <li>Signed OSX InstallAnywhere installer</li></ul>
+      <li>Signed OSX InstallAnywhere installer<br></li>
+      <li>Support for per-sequence based annotations in BioJSON</li></ul>
         <em>Applet</em>
         <ul><li>Split frame example added to applet examples page</li>
             </ul>
@@ -83,6 +84,7 @@
             <li>Disabled 'minimise' button on Jalview windows running on OSX to workaround redraw hang bug</li>
             <li>Split cDNA/Protein view position and geometry not recovered from jalview project</li>
             <li>Initial enabled/disabled state of annotation menu sorter 'show autocalculated first/last' corresponds to alignment view</li>
+            <li>Restoring of Clustal, RNA helix and TCoffee colour shcemes from BioJSON</li>
             </ul>
       <em>Applet</em><ul>
             <li>Reorder sequences mirrored in cDNA/Protein split frame</li>
index 736e786..35af554 100755 (executable)
     <strong>What's new ?</strong>
   </p>
   <p>
-    Jalview 2.9 has been in development since December 2014. In addition
+    Jalview 2.9.0b1 is a bug fix release for Jalview 2.9, which has been in development since December 2014. In addition
     to a multitude of bug fixes and minor improvements (both small, and
     rather big!), it also brings major new capabilities for codon-level
     analysis of protein alignments and the retrieval and manipulation of
-    structural data.</p><p>For the full list of changes, see the
-    <a href="releases.html#Jalview.2.9">Jalview 2.9 Release Notes</a>.
+    structural data.</p><p>For the patches since version 2.9 was release, see the
+    <a href="releases.html#Jalview.2.9.0b1">Jalview 2.9.0b1 Release Notes</a>.
   </p>
   <p>
     <strong>Highlights in Jalview 2.9</strong>
index 1d48a99..4bb3fde 100644 (file)
@@ -228,8 +228,8 @@ public class AlignmentUtils
    * @param cdnaAlignment
    * @return
    */
-  public static boolean mapProteinAlignmentToCdna(final AlignmentI proteinAlignment,
-          final AlignmentI cdnaAlignment)
+  public static boolean mapProteinAlignmentToCdna(
+          final AlignmentI proteinAlignment, final AlignmentI cdnaAlignment)
   {
     if (proteinAlignment == null || cdnaAlignment == null)
     {
@@ -429,8 +429,7 @@ public class AlignmentUtils
     {
       return null;
     }
-    if (!translatesAs(cdnaSeqChars, startOffset,
-            aaSeqChars))
+    if (!translatesAs(cdnaSeqChars, startOffset, aaSeqChars))
     {
       return null;
     }
index ea5fd5a..59c0001 100644 (file)
@@ -2081,8 +2081,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         infoPanel
                 .add(new Label(MessageManager.getString("warn.delete_all")));
 
-        final JVDialog dialog = new JVDialog(this, title, true, 400,
-                200);
+        final JVDialog dialog = new JVDialog(this, title, true, 400, 200);
         dialog.setMainPanel(infoPanel);
         dialog.ok.setLabel(MessageManager.getString("action.ok"));
         dialog.cancel.setLabel(MessageManager.getString("action.cancel"));
index e29cbe1..f28f5f8 100755 (executable)
@@ -387,7 +387,7 @@ public class Jalview
       }
       else
       {
-
+        Desktop.setCurrentAlignFrame(af);
         data = aparser.getValue("colour", true);
         if (data != null)
         {
index 4f5c4ee..6c8e533 100644 (file)
@@ -2404,8 +2404,7 @@ public class JalviewLite extends Applet implements
         return rtn;
       } catch (Exception ex)
       {
-        System.out.println("Exception checking resources: " + f + " "
-                + ex);
+        System.out.println("Exception checking resources: " + f + " " + ex);
         return false;
       }
     }
index ab11089..95141e6 100755 (executable)
@@ -957,6 +957,12 @@ public class AlignmentAnnotation
 
   }
 
+  /**
+   * When positional annotation and a sequence reference is present, clears and
+   * resizes the annotations array to the current alignment width, and adds
+   * annotation according to aligned positions of the sequenceRef given by
+   * sequenceMapping.
+   */
   public void adjustForAlignment()
   {
     if (sequenceRef == null)
@@ -980,18 +986,20 @@ public class AlignmentAnnotation
     int position;
     Annotation[] temp = new Annotation[aSize];
     Integer index;
-
-    for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++)
+    if (sequenceMapping != null)
     {
-      index = new Integer(a);
-      if (sequenceMapping.containsKey(index))
+      for (a = sequenceRef.getStart(); a <= sequenceRef.getEnd(); a++)
       {
-        position = sequenceRef.findIndex(a) - 1;
+        index = new Integer(a);
+        Annotation annot = sequenceMapping.get(index);
+        if (annot != null)
+        {
+          position = sequenceRef.findIndex(a) - 1;
 
-        temp[position] = sequenceMapping.get(index);
+          temp[position] = annot;
+        }
       }
     }
-
     annotations = temp;
   }
 
@@ -1028,11 +1036,11 @@ public class AlignmentAnnotation
   }
 
   /**
-   * Associate this annotion with the aligned residues of a particular sequence.
-   * sequenceMapping will be updated in the following way: null sequenceI -
-   * existing mapping will be discarded but annotations left in mapped
-   * positions. valid sequenceI not equal to current sequenceRef: mapping is
-   * discarded and rebuilt assuming 1:1 correspondence TODO: overload with
+   * Associate this annotation with the aligned residues of a particular
+   * sequence. sequenceMapping will be updated in the following way: null
+   * sequenceI - existing mapping will be discarded but annotations left in
+   * mapped positions. valid sequenceI not equal to current sequenceRef: mapping
+   * is discarded and rebuilt assuming 1:1 correspondence TODO: overload with
    * parameter to specify correspondence between current and new sequenceRef
    * 
    * @param sequenceI
index 06e2243..7dffdae 100644 (file)
@@ -253,8 +253,7 @@ public class Mapping
        * allow for offset e.g. treat pos 8 as 2 if sequence starts at 7
        */
       int truePos = sequencePos - (start - 1);
-      while (alignedBases < truePos
-              && alignedColumn < alignedSeq.length)
+      while (alignedBases < truePos && alignedColumn < alignedSeq.length)
       {
         if (alignedSeq[alignedColumn++] != gap)
         {
index 2829aad..b2a4cf8 100644 (file)
@@ -2415,7 +2415,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
   }
 
-
   /**
    * DOCUMENT ME!
    * 
@@ -3517,6 +3516,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         cs.setConservationInc(SliderPanel.setConservationSlider(alignPanel,
                 cs, "Background"));
       }
+      if (cs instanceof TCoffeeColourScheme)
+      {
+        tcoffeeColour.setEnabled(true);
+        tcoffeeColour.setSelected(true);
+      }
     }
 
     viewport.setGlobalColourScheme(cs);
index 145870a..e4535ff 100644 (file)
@@ -23,6 +23,7 @@ package jalview.gui;
 import jalview.api.AlignViewportI;
 import jalview.api.AlignmentViewPanel;
 import jalview.bin.Cache;
+import jalview.bin.Jalview;
 import jalview.io.FileLoader;
 import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
@@ -2381,6 +2382,12 @@ public class Desktop extends jalview.jbgui.GDesktop implements
    */
   public static AlignFrame[] getAlignFrames()
   {
+    if (Jalview.isHeadlessMode())
+    {
+      // Desktop.desktop is null in headless mode
+      return new AlignFrame[] { currentAlignFrame };
+    }
+
     JInternalFrame[] frames = Desktop.desktop.getAllFrames();
 
     if (frames == null)
index 5e2cba6..47f285c 100644 (file)
@@ -115,16 +115,15 @@ public class BioJsHTMLOutput
       AlignmentExportData exportData = jalview.gui.AlignFrame
               .getAlignmentForExport(JSONFile.FILE_DESC,
                       ap.getAlignViewport(), exportSettings);
-      String bioJSON = new FormatAdapter(ap,
-              exportData.getSettings()).formatSequences(JSONFile.FILE_DESC,
-              exportData.getAlignment(), exportData.getOmitHidden(),
-              exportData.getStartEndPostions(), ap.getAlignViewport()
-                      .getColumnSelection());
+      String bioJSON = new FormatAdapter(ap, exportData.getSettings())
+              .formatSequences(JSONFile.FILE_DESC, exportData
+                      .getAlignment(), exportData.getOmitHidden(),
+                      exportData.getStartEndPostions(), ap
+                              .getAlignViewport().getColumnSelection());
 
       String bioJSTemplateString = getBioJsTemplateAsString();
       String generatedBioJsWithJalviewAlignmentAsJson = bioJSTemplateString
-              .replaceAll("#sequenceData#", bioJSON)
-              .toString();
+              .replaceAll("#sequenceData#", bioJSON).toString();
 
       PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(
               outputFile));
index 97cd777..f48ff07 100755 (executable)
@@ -123,8 +123,7 @@ public class FeaturesFile extends AlignFile
    *          - process html strings into plain text
    * @return true if features were added
    */
-  public boolean parse(AlignmentI align, Map colours,
-          boolean removeHTML)
+  public boolean parse(AlignmentI align, Map colours, boolean removeHTML)
   {
     return parse(align, colours, null, removeHTML, false);
   }
index 6fe06eb..8e87953 100644 (file)
@@ -39,12 +39,14 @@ import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.json.binding.biojson.v1.AlignmentAnnotationPojo;
 import jalview.json.binding.biojson.v1.AlignmentPojo;
+import jalview.json.binding.biojson.v1.AnnotationDisplaySettingPojo;
 import jalview.json.binding.biojson.v1.AnnotationPojo;
 import jalview.json.binding.biojson.v1.ColourSchemeMapper;
 import jalview.json.binding.biojson.v1.SequenceFeaturesPojo;
 import jalview.json.binding.biojson.v1.SequenceGrpPojo;
 import jalview.json.binding.biojson.v1.SequencePojo;
 import jalview.schemes.ColourSchemeProperty;
+import jalview.schemes.UserColourScheme;
 import jalview.viewmodel.seqfeatures.FeaturesDisplayed;
 
 import java.awt.Color;
@@ -90,6 +92,8 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
 
   private ArrayList<SequenceI> hiddenSequences;
 
+  private final static String TCOFFEE_SCORE = "TCoffeeScore";
+
   public JSONFile()
   {
     super();
@@ -211,7 +215,10 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
       }
       else
       {
-        if (globalColourScheme.equalsIgnoreCase("RNA Helices"))
+        // These color schemes require annotation, disable them if annotations
+        // are not exported
+        if (globalColourScheme.equalsIgnoreCase("RNA Helices")
+                || globalColourScheme.equalsIgnoreCase("T-COFFEE SCORES"))
         {
           jsonAlignmentPojo.setGlobalColorScheme("None");
         }
@@ -367,6 +374,26 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
       AlignmentAnnotationPojo alignAnnotPojo = new AlignmentAnnotationPojo();
       alignAnnotPojo.setDescription(annot.description);
       alignAnnotPojo.setLabel(annot.label);
+      if (!Double.isNaN(annot.score))
+      {
+        alignAnnotPojo.setScore(annot.score);
+      }
+      alignAnnotPojo.setCalcId(annot.getCalcId());
+      alignAnnotPojo.setGraphType(annot.graph);
+
+      AnnotationDisplaySettingPojo annotSetting = new AnnotationDisplaySettingPojo();
+      annotSetting.setBelowAlignment(annot.belowAlignment);
+      annotSetting.setCentreColLabels(annot.centreColLabels);
+      annotSetting.setScaleColLabel(annot.scaleColLabel);
+      annotSetting.setShowAllColLabels(annot.showAllColLabels);
+      annotSetting.setVisible(annot.visible);
+      annotSetting.setHasIcon(annot.hasIcons);
+      alignAnnotPojo.setAnnotationSettings(annotSetting);
+      SequenceI refSeq = annot.sequenceRef;
+      if (refSeq != null)
+      {
+        alignAnnotPojo.setSequenceRef(String.valueOf(refSeq.hashCode()));
+      }
       for (Annotation annotation : annot.annotations)
       {
         AnnotationPojo annotationPojo = new AnnotationPojo();
@@ -376,12 +403,28 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
           annotationPojo.setValue(annotation.value);
           annotationPojo
                   .setSecondaryStructure(annotation.secondaryStructure);
-          annotationPojo.setDisplayCharacter(annotation.displayCharacter);
+          String displayChar = annotation.displayCharacter == null ? null
+                  : annotation.displayCharacter;
+          // System.out.println("--------------------->[" + displayChar + "]");
+          annotationPojo.setDisplayCharacter(displayChar);
+          if (annotation.colour != null)
+          {
+            annotationPojo.setColour(jalview.util.Format
+                    .getHexString(annotation.colour));
+          }
           alignAnnotPojo.getAnnotations().add(annotationPojo);
         }
         else
         {
-          alignAnnotPojo.getAnnotations().add(annotationPojo);
+          if (annot.getCalcId() != null
+                  && annot.getCalcId().equalsIgnoreCase(TCOFFEE_SCORE))
+          {
+            // do nothing
+          }
+          else
+          {
+            alignAnnotPojo.getAnnotations().add(annotationPojo);
+          }
         }
       }
       jsonAnnotations.add(alignAnnotPojo);
@@ -439,7 +482,6 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
         seqMap.put(seqUniqueId, seq);
       }
 
-
       parseFeatures(jsonSeqArray);
 
       for (Iterator<JSONObject> seqGrpIter = seqGrpJsonArray.iterator(); seqGrpIter
@@ -478,8 +520,7 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
           }
         }
         SequenceGroup seqGrp = new SequenceGroup(grpSeqs, grpName, null,
-                displayBoxes, displayText, colourText,
-                startRes, endRes);
+                displayBoxes, displayText, colourText, startRes, endRes);
         seqGrp.cs = ColourSchemeMapper.getJalviewColourScheme(colourScheme,
                 seqGrp);
         seqGrp.setShowNonconserved(showNonconserved);
@@ -517,6 +558,12 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
                     : annot.get("displayCharacter").toString();
 
             annotations[count] = new Annotation(displayChar, desc, ss, val);
+            if (annot.get("colour") != null)
+            {
+              Color color = UserColourScheme.getColourFromString(annot.get(
+                      "colour").toString());
+              annotations[count].colour = color;
+            }
           }
           ++count;
         }
@@ -524,7 +571,64 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
         AlignmentAnnotation alignAnnot = new AlignmentAnnotation(alAnnot
                 .get("label").toString(), alAnnot.get("description")
                 .toString(), annotations);
+        alignAnnot.graph = (alAnnot.get("graphType") == null) ? 0 : Integer
+                .valueOf(alAnnot.get("graphType").toString());
+
+        JSONObject diplaySettings = (JSONObject) alAnnot
+                .get("annotationSettings");
+        if (diplaySettings != null)
+        {
+
+          alignAnnot.scaleColLabel = (diplaySettings.get("scaleColLabel") == null) ? false
+                  : Boolean.valueOf(diplaySettings.get("scaleColLabel")
+                          .toString());
+          alignAnnot.showAllColLabels = (diplaySettings
+                  .get("showAllColLabels") == null) ? true : Boolean
+                  .valueOf(diplaySettings.get("showAllColLabels")
+                          .toString());
+          alignAnnot.centreColLabels = (diplaySettings
+                  .get("centreColLabels") == null) ? true
+                  : Boolean.valueOf(diplaySettings.get("centreColLabels")
+                          .toString());
+          alignAnnot.belowAlignment = (diplaySettings.get("belowAlignment") == null) ? false
+                  : Boolean.valueOf(diplaySettings.get("belowAlignment")
+                          .toString());
+          alignAnnot.visible = (diplaySettings.get("visible") == null) ? true
+                  : Boolean.valueOf(diplaySettings.get("visible")
+                          .toString());
+          alignAnnot.hasIcons = (diplaySettings.get("hasIcon") == null) ? true
+                  : Boolean.valueOf(diplaySettings.get("hasIcon")
+                          .toString());
+
+        }
+        if (alAnnot.get("score") != null)
+        {
+          alignAnnot.score = Double
+                  .valueOf(alAnnot.get("score").toString());
+        }
+
+        String calcId = (alAnnot.get("calcId") == null) ? "" : alAnnot.get(
+                "calcId").toString();
+        alignAnnot.setCalcId(calcId);
+        String seqHash = (alAnnot.get("sequenceRef") != null) ? alAnnot
+                .get("sequenceRef").toString() : null;
+
+        Sequence sequence = (seqHash != null) ? seqMap.get(seqHash) : null;
+        if (sequence != null)
+        {
+          alignAnnot.sequenceRef = sequence;
+          sequence.addAlignmentAnnotation(alignAnnot);
+          if (alignAnnot.label.equalsIgnoreCase("T-COFFEE"))
+          {
+            alignAnnot.createSequenceMapping(sequence, sequence.getStart(),
+                    false);
+            sequence.addAlignmentAnnotation(alignAnnot);
+            alignAnnot.adjustForAlignment();
+          }
+        }
+        alignAnnot.validateRangeAndDisplay();
         this.annotations.add(alignAnnot);
+
       }
     } catch (Exception e)
     {
@@ -641,10 +745,6 @@ public class JSONFile extends AlignFile implements ComplexAlignFile
     {
       if (annot != null && !annot.autoCalculated)
       {
-        if (!annot.visible)
-        {
-          continue;
-        }
         annotations.add(annot);
       }
     }
index 0e8617e..b08aeca 100644 (file)
@@ -34,9 +34,6 @@ import jalview.structure.StructureMappingcommandSet;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.HttpUtils;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
index 25924f0..67b3a20 100644 (file)
@@ -296,7 +296,7 @@ public abstract class GStructureChooser extends JPanel implements
           {
             if (btn_view.isEnabled())
             {
-            btn_view.requestFocus();
+              btn_view.requestFocus();
             }
             else
             {
index ab350eb..a8a3218 100644 (file)
@@ -30,17 +30,41 @@ public class AlignmentAnnotationPojo
 
   @Attributes(
     required = false,
-    description = "Label for the Alignment Annotation")
+    description = "Label for the alignment annotation")
   private String label;
 
   @Attributes(
     required = false,
-    description = "Description for the Alignment Annotation")
+    description = "Description for the alignment annotation")
   private String description;
 
   @Attributes(required = false)
   private List<AnnotationPojo> annotations = new ArrayList<AnnotationPojo>();
 
+  @Attributes(
+    required = false,
+    enums = { "0", "1", "2" },
+    description = "Determines the rendering for the annotation<br><ul><li>0 - No graph</li><li>1 - Bar Graph</li><li>2 - Line graph</li></ul>")
+  private int graphType;
+
+  @Attributes(
+    required = false,
+    description = "Reference to the sequence in the alignment<br> if per-sequence annotation")
+  private String sequenceRef;
+
+  @Attributes(
+    required = false,
+    description = "Stores display settings for an annotation")
+  private AnnotationDisplaySettingPojo annotationSettings;
+
+  @Attributes(required = false, description = "Score of the annotation")
+  private double score;
+
+  @Attributes(
+    required = false,
+    description = "The annotation generation source")
+  private String calcId;
+
   public String getLabel()
   {
     return label;
@@ -71,4 +95,55 @@ public class AlignmentAnnotationPojo
     this.annotations = annotations;
   }
 
+  public String getSequenceRef()
+  {
+    return sequenceRef;
+  }
+
+  public void setSequenceRef(String sequenceRef)
+  {
+    this.sequenceRef = sequenceRef;
+  }
+
+  public int getGraphType()
+  {
+    return graphType;
+  }
+
+  public void setGraphType(int graphType)
+  {
+    this.graphType = graphType;
+  }
+
+  public AnnotationDisplaySettingPojo getAnnotationSettings()
+  {
+    return annotationSettings;
+  }
+
+  public void setAnnotationSettings(
+          AnnotationDisplaySettingPojo annotationSettings)
+  {
+    this.annotationSettings = annotationSettings;
+  }
+
+  public double getScore()
+  {
+    return score;
+  }
+
+  public void setScore(double score)
+  {
+    this.score = score;
+  }
+
+  public String getCalcId()
+  {
+    return calcId;
+  }
+
+  public void setCalcId(String calcId)
+  {
+    this.calcId = calcId;
+  }
+
 }
diff --git a/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java b/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java
new file mode 100644 (file)
index 0000000..d493bf2
--- /dev/null
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ ******************************************************************************/
+package jalview.json.binding.biojson.v1;
+
+import com.github.reinert.jjschema.Attributes;
+
+public class AnnotationDisplaySettingPojo
+{
+
+  @Attributes(
+    required = false,
+    description = "Indicates if column label is scaled to fit within the <br>alignment column")
+  private boolean scaleColLabel;
+
+  @Attributes(
+    required = false,
+    description = "Indicates if every column label is displayed.")
+  private boolean showAllColLabels;
+
+  @Attributes(
+    required = false,
+    description = "Indicates if column labels is centred relative to the <br>alignment column")
+  private boolean centreColLabels;
+
+  @Attributes(
+    required = false,
+    description = "Indicates if the Annotation is shown below the alignment")
+  private boolean belowAlignment;
+
+  @Attributes(
+    required = false,
+    description = "Indicates if the annotation row is visible")
+  private boolean visible;
+
+  @Attributes(
+    required = false,
+    description = "Indicates if annotation has a graphical symbol track")
+  private boolean hasIcon;
+
+  public boolean isScaleColLabel()
+  {
+    return scaleColLabel;
+  }
+
+  public void setScaleColLabel(boolean scaleColLabel)
+  {
+    this.scaleColLabel = scaleColLabel;
+  }
+
+  public boolean isShowAllColLabels()
+  {
+    return showAllColLabels;
+  }
+
+  public void setShowAllColLabels(boolean showAllColLabels)
+  {
+    this.showAllColLabels = showAllColLabels;
+  }
+
+  public boolean isCentreColLabels()
+  {
+    return centreColLabels;
+  }
+
+  public void setCentreColLabels(boolean centreColLabels)
+  {
+    this.centreColLabels = centreColLabels;
+  }
+
+  public boolean isBelowAlignment()
+  {
+    return belowAlignment;
+  }
+
+  public void setBelowAlignment(boolean belowAlignment)
+  {
+    this.belowAlignment = belowAlignment;
+  }
+
+  public boolean isVisible()
+  {
+    return visible;
+  }
+
+  public void setVisible(boolean visible)
+  {
+    this.visible = visible;
+  }
+
+  public boolean isHasIcon()
+  {
+    return hasIcon;
+  }
+
+  public void setHasIcon(boolean hasIcon)
+  {
+    this.hasIcon = hasIcon;
+  }
+
+}
index d1cb71c..54effda 100644 (file)
@@ -43,6 +43,11 @@ public class AnnotationPojo
   @Attributes(required = false, description = "Value of the annotation")
   private float value;
 
+  @Attributes(
+    required = false,
+    description = "Colour of the annotation position in hex string.")
+  private String colour;
+
   public String getDisplayCharacter()
   {
     return displayCharacter;
@@ -83,4 +88,14 @@ public class AnnotationPojo
     this.value = value;
   }
 
+  public String getColour()
+  {
+    return colour;
+  }
+
+  public void setColour(String colour)
+  {
+    this.colour = colour;
+  }
+
 }
index aeab34c..b3422ab 100644 (file)
@@ -58,6 +58,7 @@ public class ColourSchemeMapper
     csPID = new PIDColourScheme();
     csBlosum62 = new Blosum62ColourScheme();
   }
+
   public static ColourSchemeI getJalviewColourScheme(
           String colourSchemeName, AnnotatedCollectionI annotCol)
   {
index f269bdf..1d2aad3 100644 (file)
@@ -11,7 +11,6 @@ package jalview.schemabinding.version2.descriptors;
 //- Imported classes and packages -/
 //---------------------------------/
 
-
 /**
  * Class AnnotationColoursDescriptor.
  * 
index 5a5b4a9..a7ffaba 100644 (file)
@@ -11,7 +11,6 @@ package jalview.schemabinding.version2.descriptors;
 //- Imported classes and packages -/
 //---------------------------------/
 
-
 /**
  * Class FeaturesDescriptor.
  * 
index 527b16b..ece728a 100644 (file)
@@ -11,7 +11,6 @@ package jalview.schemabinding.version2.descriptors;
 //- Imported classes and packages -/
 //---------------------------------/
 
-
 /**
  * Class UserColourSchemeDescriptor.
  * 
index fc7f9ba..86e6992 100644 (file)
@@ -11,7 +11,6 @@ package jalview.schemabinding.version2.descriptors;
 //- Imported classes and packages -/
 //---------------------------------/
 
-
 /**
  * Class VamsasModelDescriptor.
  * 
index 89f3eed..dec0a41 100755 (executable)
@@ -99,7 +99,7 @@ public class UserColourScheme extends ResidueColourScheme
     return schemeName;
   }
 
-  public Color getColourFromString(String colour)
+  public static Color getColourFromString(String colour)
   {
     colour = colour.trim();
 
index 88df587..991a20a 100644 (file)
@@ -1,3 +1,23 @@
+/*******************************************************************************
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ ******************************************************************************/
 package jalview.util;
 
 import java.io.IOException;
index adf3eb3..f07b302 100644 (file)
@@ -622,11 +622,10 @@ public class DBRefFetcher implements Runnable
           // absStart = 0;
           // create valid mapping between matching region of local sequence and
           // the mapped sequence
-          mp = new Mapping(null, new int[] {
-              sequenceStart + absStart,
-              sequenceStart + absStart + entrySeq.length() - 1 },
-                  new int[] { entry.getStart(),
-                      entry.getStart() + entrySeq.length() - 1 }, 1, 1);
+          mp = new Mapping(null, new int[] { sequenceStart + absStart,
+              sequenceStart + absStart + entrySeq.length() - 1 }, new int[]
+          { entry.getStart(), entry.getStart() + entrySeq.length() - 1 },
+                  1, 1);
           updateRefFrame = false; // mapping is based on current start/end so
           // don't modify start and end
         }
index 09224c9..5b13bb9 100644 (file)
@@ -20,7 +20,6 @@
  */
 package jalview.ws.uimodel;
 
-
 public class AlignAnalysisUIText
 {
 
index 5013b35..7840824 100644 (file)
@@ -27,6 +27,7 @@ import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
 
 import java.util.List;
 
index 047aae8..8276300 100644 (file)
@@ -1,3 +1,23 @@
+/*******************************************************************************
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ ******************************************************************************/
 package jalview.bin;
 
 import static org.testng.AssertJUnit.assertEquals;
@@ -7,7 +27,6 @@ import java.util.Arrays;
 
 import org.testng.annotations.Test;
 
-
 public class JalviewLiteTest
 {
 
@@ -19,7 +38,7 @@ public class JalviewLiteTest
     assertNull(JalviewLite.separatorListToArray("|", "|"));
     assertNull(JalviewLite.separatorListToArray("abc", "abc"));
 
-    String [] array = JalviewLite.separatorListToArray("abc|def|ghi|", "|");
+    String[] array = JalviewLite.separatorListToArray("abc|def|ghi|", "|");
     assertEquals(3, array.length);
     assertEquals("abc", array[0]);
     assertEquals("def", array[1]);
index f56cd51..520d1bb 100644 (file)
@@ -38,8 +38,7 @@ import org.testng.annotations.Test;
 public class FeaturesFileTest
 {
 
-  static String TestFiles[][] = {
- { "Test example features import/export",
+  static String TestFiles[][] = { { "Test example features import/export",
       "examples/uniref50.fa", "examples/exampleFeatures.txt" } };
 
   @Test(groups = { "Functional" })
index e0b050f..bd7ec71 100644 (file)
@@ -324,9 +324,6 @@ public class JSONFileTest
             "Colourscheme is null, parsing failed!");
     Assert.assertEquals(testJsonFile.getGlobalColourScheme(), "Zappo",
             "Zappo colour scheme expected!");
-    // Assert.assertTrue(
-    // testJsonFile.getGlobalColourScheme() instanceof ZappoColourScheme,
-    // "Zappo colour scheme expected!");
   }
 
   @Test(groups = { "Functional" })
index 46a648a..4116eaf 100644 (file)
@@ -364,8 +364,7 @@ public class MappingUtilsTest
 
     // map second dna to second protein seq
     map = new MapList(new int[] { 20, 20, 22, 23, 24, 26 }, new int[] { 50,
-        51 },
-            3, 1);
+        51 }, 3, 1);
     acf.addMap(cdna.getSequenceAt(1).getDatasetSequence(), protein
             .getSequenceAt(1).getDatasetSequence(), map);
 
index 5e8cd8c..2d5b4b3 100644 (file)
@@ -1,3 +1,23 @@
+/*******************************************************************************
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ ******************************************************************************/
 package jalview.util;
 
 import static org.testng.AssertJUnit.assertEquals;
index 58f7694..76375d6 100644 (file)
@@ -1,3 +1,23 @@
+/*******************************************************************************
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ ******************************************************************************/
 //
 //========================================================================
 //Copyright (c) 1995-2015 Mort Bay Consulting Pty. Ltd.
@@ -70,4 +90,4 @@ public class JettyExamplesDir
     server.start();
     server.join();
 }
-}
\ No newline at end of file
+}