From d43b22658a3041c6c5c28c0db3d52c648dcf92e9 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 17 Feb 2020 15:27:15 +0000 Subject: [PATCH] =?utf8?q?JAL-3534=20patch=20for=20simple=20case=20(Protein=20?= =?utf8?q?or=20Nucleotide,=20but=20not=20linked):=20transfer=20feature=20set?= =?utf8?q?tings=20dialog=20ref=20to=20exploded=20views,=20and=20preserve=20o?= =?utf8?q?ne=20of=20the=20feature=20settings=20dialogs=20refs=20when=20views?= =?utf8?q?=20are=20gathered=20again=E2=80=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/gui/Desktop.java | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 1ec6939..22280ed 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -1923,11 +1923,22 @@ public class Desktop extends jalview.jbgui.GDesktop return; } + // FIXME: ideally should use UI interface API + FeatureSettings viewFeatureSettings = af.featureSettings; + Rectangle fsBounds = af.getFeatureSettingsGeometry(); for (int i = 0; i < size; i++) { AlignmentPanel ap = af.alignPanels.get(i); + AlignFrame newaf = new AlignFrame(ap); + // transfer reference for existing feature settings to new alignFrame + if (ap == af.alignPanel) + { + newaf.featureSettings = viewFeatureSettings; + newaf.setFeatureSettingsGeometry(fsBounds); + } + /* * Restore the view's last exploded frame geometry if known. Multiple * views from one exploded frame share and restore the same (frame) @@ -1964,7 +1975,6 @@ public class Desktop extends jalview.jbgui.GDesktop source.viewport.setExplodedGeometry(source.getBounds()); JInternalFrame[] frames = desktop.getAllFrames(); String viewId = source.viewport.getSequenceSetId(); - for (int t = 0; t < frames.length; t++) { if (frames[t] instanceof AlignFrame && frames[t] != source) @@ -1985,6 +1995,21 @@ public class Desktop extends jalview.jbgui.GDesktop if (gatherThis) { + if (af.featureSettings != null) + { + if (source.featureSettings == null) + { + // preserve the feature settings geometry for this frame + source.featureSettings = af.featureSettings; + source.setFeatureSettingsGeometry( + af.getFeatureSettingsGeometry()); + } + else + { + // close it and forget + af.featureSettings.close(); + } + } af.alignPanels.clear(); af.closeMenuItem_actionPerformed(true); } -- 1.7.10.2