From 6936b57e5469c796a998d661a7a07648832ccf70 Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Wed, 7 Oct 2015 17:39:59 +0100 Subject: [PATCH] JAL-1912 added documentation --- src/jalview/io/JSONFile.java | 13 +++++++----- .../biojson/v1/AlignmentAnnotationPojo.java | 10 ++++++---- .../biojson/v1/AnnotationDisplaySettingPojo.java | 21 ++++++++++++++++++++ .../json/binding/biojson/v1/AnnotationPojo.java | 4 +++- 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/jalview/io/JSONFile.java b/src/jalview/io/JSONFile.java index 564dd64..9e94d91 100644 --- a/src/jalview/io/JSONFile.java +++ b/src/jalview/io/JSONFile.java @@ -558,11 +558,14 @@ public class JSONFile extends AlignFile implements ComplexAlignFile .get("secondaryStructure").toString().charAt(0); String displayChar = annot.get("displayCharacter") == null ? "" : annot.get("displayCharacter").toString(); - Color color = annot.get("colour") == null ? Color.white - : UserColourScheme.getColourFromString(annot.get( - "colour").toString()); - annotations[count] = new Annotation(displayChar, desc, ss, val, - color); + + 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; } diff --git a/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java b/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java index 7e729f9..a9e57a9 100644 --- a/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java +++ b/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java @@ -30,12 +30,12 @@ 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) @@ -44,7 +44,7 @@ public class AlignmentAnnotationPojo @Attributes( required = false, enums = { "0", "1", "2" }, - description = "Determines the rendered for the annotation
") + description = "Determines the rendering for the annotation
") private int graphType; @Attributes( @@ -60,7 +60,9 @@ public class AlignmentAnnotationPojo @Attributes(required = false, description = "Score of the annotation") private double score; - @Attributes(required = false, description = "Annotation generation source") + @Attributes( + required = false, + description = "The annotation generation source") private String calcId; public String getLabel() diff --git a/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java b/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java index ac1cbe4..be50b79 100644 --- a/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java +++ b/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java @@ -1,17 +1,38 @@ 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
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
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() diff --git a/src/jalview/json/binding/biojson/v1/AnnotationPojo.java b/src/jalview/json/binding/biojson/v1/AnnotationPojo.java index a4d7f17..d49c1d5 100644 --- a/src/jalview/json/binding/biojson/v1/AnnotationPojo.java +++ b/src/jalview/json/binding/biojson/v1/AnnotationPojo.java @@ -43,7 +43,9 @@ public class AnnotationPojo @Attributes(required = false, description = "Value of the annotation") private float value; - @Attributes(required = false, description = "Colour for position") + @Attributes( + required = false, + description = "Colour of the annotation position in hex string.") private String colour; public String getDisplayCharacter() -- 1.7.10.2