From 2b2e4f5da97889b83c6f8b0fbe41f163feca7e82 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 6 Sep 2012 18:16:55 +0100 Subject: [PATCH] JAL-958 flag indicating if visualization settings for new group annotation should be overwritten or preserverd --- src/jalview/gui/AlignmentPanel.java | 9 ++++++--- src/jalview/gui/Jalview2XML.java | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 8f2dd04..bcdd620 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -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); diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index e283f27..72e9698 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -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; } -- 1.7.10.2