Merge branch 'Release_2_8_0b1_Branch' into try_r20b1_merge
[jalview.git] / src / jalview / gui / Jalview2XML.java
index 7e4bf71..28ac886 100644 (file)
@@ -430,7 +430,7 @@ public class Jalview2XML
     object.setVamsasModel(new jalview.schemabinding.version2.VamsasModel());
 
     object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
-    object.setVersion(jalview.bin.Cache.getProperty("VERSION"));
+    object.setVersion(jalview.bin.Cache.getDefault("VERSION","Development Build"));
 
     jalview.datamodel.AlignmentI jal = av.getAlignment();
 
@@ -1070,6 +1070,8 @@ public class Jalview2XML
 
       ac.setMaxColour(acg.getMaxColour().getRGB());
       ac.setMinColour(acg.getMinColour().getRGB());
+      ac.setPerSequence(acg.isSeqAssociated());
+      ac.setPredefinedColours(acg.isPredefinedColours());
       view.setAnnotationColours(ac);
       view.setBgColour("AnnotationColourGradient");
     }
@@ -3239,7 +3241,14 @@ public class Jalview2XML
                                 .getAnnotationColours().getColourScheme()),
                         view.getAnnotationColours().getAboveThreshold());
               }
-
+              if (view.getAnnotationColours().hasPerSequence())
+              {
+                ((AnnotationColourGradient)cs).setSeqAssociated(view.getAnnotationColours().isPerSequence());
+              }
+              if (view.getAnnotationColours().hasPredefinedColours())
+              {
+                ((AnnotationColourGradient)cs).setPredefinedColours(view.getAnnotationColours().isPredefinedColours());
+              }
               // Also use these settings for all the groups
               if (al.getGroups() != null)
               {
@@ -3269,6 +3278,17 @@ public class Jalview2XML
                             .getAlignment().getAlignmentAnnotation()[i],
                             sg.cs, view.getAnnotationColours()
                                     .getAboveThreshold());
+                    if (cs instanceof AnnotationColourGradient) 
+                    {
+                      if (view.getAnnotationColours().hasPerSequence())
+                      { 
+                        ((AnnotationColourGradient)cs).setSeqAssociated(view.getAnnotationColours().isPerSequence());
+                      }
+                      if (view.getAnnotationColours().hasPredefinedColours())
+                      {
+                        ((AnnotationColourGradient)cs).setPredefinedColours(view.getAnnotationColours().isPredefinedColours());
+                      }
+                    }
                   }
 
                 }
@@ -3468,6 +3488,7 @@ public class Jalview2XML
             view.getHeight());
     af.alignPanel.updateAnnotation(false, true); // recompute any autoannotation
     reorderAutoannotation(af, al, autoAlan);
+    af.alignPanel.alignmentChanged();
     return af;
   }