JAL-958 flag indicating if visualization settings for new group annotation should...
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 6 Sep 2012 17:16:55 +0000 (18:16 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 6 Sep 2012 17:16:55 +0000 (18:16 +0100)
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/Jalview2XML.java

index 8f2dd04..bcdd620 100644 (file)
@@ -1394,11 +1394,14 @@ public class AlignmentPanel extends GAlignmentPanel implements
    */
   public void updateAnnotation()
   {
-    updateAnnotation(false);
+    updateAnnotation(false, false);
   }
-
   public void updateAnnotation(boolean applyGlobalSettings)
   {
+    updateAnnotation(applyGlobalSettings,false);
+  }
+  public void updateAnnotation(boolean applyGlobalSettings, boolean preserveNewGroupSettings)
+  {
     // TODO: this should be merged with other annotation update stuff - that
     // sits on AlignViewport
     boolean updateCalcs = false;
@@ -1434,7 +1437,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       for (SequenceGroup sg:av.getAlignment().getGroups())
       {
         updateCalcs = false;
-        if (applyGlobalSettings || !oldrfs.containsKey(sg))
+        if (applyGlobalSettings || (!preserveNewGroupSettings && !oldrfs.containsKey(sg)))
         {
           // set defaults for this group's conservation/consensus
           sg.setshowSequenceLogo(showprf);
index e283f27..72e9698 100644 (file)
@@ -3427,7 +3427,7 @@ public class Jalview2XML
     // TODO: we don't need to do this if the viewport is aready visible.
     Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(),
             view.getHeight());
-    af.alignPanel.updateAnnotation(false); // recompute any autoannotation
+    af.alignPanel.updateAnnotation(false, true); // recompute any autoannotation
     reorderAutoannotation(af, al, autoAlan);
     return af;
   }