From: Jim Procter Date: Mon, 17 Feb 2020 15:27:15 +0000 (+0000) Subject: JAL-3534 patch for simple case (Protein or Nucleotide, but not linked): transfer... X-Git-Tag: Develop-2_11_2_0-d20201215~101^2~10 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=d43b22658a3041c6c5c28c0db3d52c648dcf92e9;p=jalview.git JAL-3534 patch for simple case (Protein or Nucleotide, but not linked): transfer feature settings dialog ref to exploded views, and preserve one of the feature settings dialogs refs when views are gathered again
 --- 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); }