JAL-3187 JAL-3533 JAL-3535 set feature settings dialog title from view, and stash...
[jalview.git] / src / jalview / gui / FeatureSettings.java
index 961ff14..4b0a0bc 100644 (file)
@@ -385,17 +385,36 @@ public class FeatureSettings extends JPanel
     {
       frame = new JInternalFrame();
       frame.setContentPane(this);
-      if (Platform.isAMac())
+      Rectangle bounds = af.getFeatureSettingsGeometry();
+      String title;
+      if (af.getAlignPanels().size() > 1 || Desktop.getAlignmentPanels(
+              af.alignPanel.av.getSequenceSetId()).length > 1)
       {
-        Desktop.addInternalFrame(frame,
-                MessageManager.getString("label.sequence_feature_settings"),
-                600, 480);
+        title = MessageManager.formatMessage(
+                "label.sequence_feature_settings_for_view",
+                af.alignPanel.getViewName());
       }
       else
       {
-        Desktop.addInternalFrame(frame,
-                MessageManager.getString("label.sequence_feature_settings"),
-                600, 450);
+        title = MessageManager.getString("label.sequence_feature_settings");
+      }
+      if (bounds == null)
+      {
+        if (Platform.isAMac())
+        {
+          Desktop.addInternalFrame(frame, title, 600, 480);
+        }
+        else
+        {
+          Desktop.addInternalFrame(frame, title, 600, 450);
+        }
+      }
+      else
+      {
+        Desktop.addInternalFrame(frame, title,
+                false, bounds.width, bounds.height);
+        frame.setBounds(bounds);
+        frame.setVisible(true);
       }
       frame.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
 
@@ -1110,12 +1129,13 @@ public class FeatureSettings extends JPanel
     {
       if (frame != null)
       {
+        af.setFeatureSettingsGeometry(frame.getBounds());
         frame.setClosed(true);
       }
       else
       {
         SplitContainerI sc = af.getSplitViewContainer();
-        sc.closeFeatureSettings(this);
+        sc.closeFeatureSettings(this, closeContainingFrame);
         af.featureSettings = null;
       }
     } catch (Exception exe)