From: jprocter Date: Thu, 22 Apr 2010 12:01:14 +0000 (+0000) Subject: feature settings is updated if new features are added and dialog is refreshed on... X-Git-Tag: Release_2_5~62 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5dcc88d296a23c37cd4b47930afdee666e016f88;p=jalview.git feature settings is updated if new features are added and dialog is refreshed on a reload --- 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); }