feature settings is updated if new features are added and dialog is refreshed on...
authorjprocter <Jim Procter>
Thu, 22 Apr 2010 12:01:14 +0000 (12:01 +0000)
committerjprocter <Jim Procter>
Thu, 22 Apr 2010 12:01:14 +0000 (12:01 +0000)
src/jalview/gui/AlignFrame.java

index aef8961..679d736 100755 (executable)
@@ -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);
     }