JAL-1912 updated AnnotationDisplaySettingPojo
authortcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 5 Oct 2015 09:54:54 +0000 (10:54 +0100)
committertcofoegbu <tcnofoegbu@dundee.ac.uk>
Mon, 5 Oct 2015 09:54:54 +0000 (10:54 +0100)
src/jalview/io/JSONFile.java
src/jalview/json/binding/biojson/v1/AnnotationDisplaySettingPojo.java

index 7e7052f..b778b83 100644 (file)
@@ -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)
     {
index a3011a0..ac1cbe4 100644 (file)
@@ -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;
+  }
+
 }