From 5dcc88d296a23c37cd4b47930afdee666e016f88 Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 22 Apr 2010 12:01:14 +0000 Subject: [PATCH] feature settings is updated if new features are added and dialog is refreshed on a reload --- src/jalview/gui/AlignFrame.java | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index aef8961..679d736 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -793,6 +793,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { if (fileName != null) { + // TODO: work out how to recover feature settings for correct view(s) when file is reloaded. if (currentFileFormat.equals("Jalview")) { JInternalFrame[] frames = Desktop.desktop.getAllFrames(); @@ -827,7 +828,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, protocol, currentFileFormat); newframe.setBounds(bounds); - + if (featureSettings!=null && featureSettings.isShowing()) { + final Rectangle fspos = featureSettings.frame.getBounds(); + // TODO: need a 'show feature settings' function that takes bounds - need to refactor Desktop.addFrame + newframe.featureSettings_actionPerformed(null); + final FeatureSettings nfs = newframe.featureSettings; + SwingUtilities.invokeLater(new Runnable() { + public void run() + { + nfs.frame.setBounds(fspos); + } + }); + this.featureSettings.close(); + this.featureSettings=null; + } this.closeMenuItem_actionPerformed(true); } } @@ -4100,6 +4114,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // update the min/max ranges where necessary alignPanel.seqPanel.seqCanvas.fr.findAllFeatures(true); } + if (featureSettings!=null) + { + featureSettings.setTableData(); + } alignPanel.paintAlignment(true); } -- 1.7.10.2