From cf4a342e06c80456393620b28820fa616fbc221c Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Mon, 5 Oct 2015 10:54:54 +0100 Subject: [PATCH] JAL-1912 updated AnnotationDisplaySettingPojo --- src/jalview/io/JSONFile.java | 13 +++++++++++-- .../binding/biojson/v1/AnnotationDisplaySettingPojo.java | 13 +++++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/jalview/io/JSONFile.java b/src/jalview/io/JSONFile.java index 7e7052f..b778b83 100644 --- a/src/jalview/io/JSONFile.java +++ b/src/jalview/io/JSONFile.java @@ -384,9 +384,10 @@ public class JSONFile extends AlignFile implements ComplexAlignFile AnnotationDisplaySettingPojo annotSetting = new AnnotationDisplaySettingPojo(); annotSetting.setBelowAlignment(annot.belowAlignment); annotSetting.setCentreColLabels(annot.centreColLabels); - annotSetting.setScaleColLabel(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) @@ -402,7 +403,10 @@ 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 @@ -592,6 +596,9 @@ public class JSONFile extends AlignFile implements ComplexAlignFile 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) @@ -619,7 +626,9 @@ public class JSONFile extends AlignFile implements ComplexAlignFile alignAnnot.adjustForAlignment(); } } + // alignAnnot.validateRangeAndDisplay(); this.annotations.add(alignAnnot); + } } catch (Exception e) { diff --git a/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java b/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java index a3011a0..ac1cbe4 100644 --- a/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java +++ b/src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java @@ -12,6 +12,8 @@ public class AnnotationDisplaySettingPojo private boolean visible; + private boolean hasIcon; + public boolean isScaleColLabel() { return scaleColLabel; @@ -61,4 +63,15 @@ public class AnnotationDisplaySettingPojo { this.visible = visible; } + + public boolean isHasIcon() + { + return hasIcon; + } + + public void setHasIcon(boolean hasIcon) + { + this.hasIcon = hasIcon; + } + } -- 1.7.10.2