JAL-3436 move/rename/private fields refactoring only
[jalview.git] / src / jalview / gui / AlignFrame.java
index 0b84e9b..2ef31a2 100644 (file)
@@ -194,9 +194,9 @@ public class AlignFrame extends GAlignFrame
   /**
    * Current filename for this alignment
    */
-  String fileName = null;
+  private String fileName = null;
 
-  File fileObject;
+  private File fileObject;
 
   /**
    * Creates a new AlignFrame object with specific width and height.
@@ -1053,6 +1053,7 @@ public class AlignFrame extends GAlignFrame
   @Override
   public void reload_actionPerformed(ActionEvent e)
   {
+    System.out.println("AlignFrame.reload " + fileName);
     if (fileName != null)
     {
       // TODO: JAL-1108 - ensure all associated frames are closed regardless of
@@ -1084,7 +1085,9 @@ public class AlignFrame extends GAlignFrame
         DataSourceType protocol = fileName.startsWith("http:")
                 ? DataSourceType.URL
                 : DataSourceType.FILE;
-        loader.loadFile(viewport, fileName, protocol, currentFileFormat);
+        loader.loadFile(viewport,
+                (fileObject == null ? fileName : fileObject), protocol,
+                currentFileFormat);
       }
       else
       {
@@ -3393,13 +3396,11 @@ public class AlignFrame extends GAlignFrame
     // undecorated overview with defined size
     frame.setName(Jalview.getAppID("overview"));
     //
-    Dimension dim = (Dimension) Platform.getEmbeddedAttribute(frame,
-            Platform.EMBEDDED_DIM);
+    Dimension dim = Platform.getDimIfEmbedded(frame, -1, -1);
     if (dim != null && dim.width == 0)
     {
       dim = null; // hidden, not embedded
     }
-
     OverviewPanel overview = new OverviewPanel(alignPanel, dim);
 
     frame.setContentPane(overview);
@@ -3778,7 +3779,8 @@ public class AlignFrame extends GAlignFrame
 
     frameTitle += this.title;
 
-    Desktop.addInternalFrame(tp, frameTitle, 600, 500);
+    Dimension dim = Platform.getDimIfEmbedded(tp, 600, 500);
+    Desktop.addInternalFrame(tp, frameTitle, dim.width, dim.height);
   }
 
   /**
@@ -4130,15 +4132,24 @@ public class AlignFrame extends GAlignFrame
       if (nf.getTree() != null)
       {
         tp = new TreePanel(alignPanel, nf, treeTitle, input);
-
-        tp.setSize(w, h);
+        Dimension dim = Platform.getDimIfEmbedded(tp, -1, -1);
+        if (dim == null)
+        {
+          dim = new Dimension(w, h);
+        }
+        else
+        {
+          // no offset, either
+          x = 0;
+        }
+        tp.setSize(dim.width, dim.height);
 
         if (x > 0 && y > 0)
         {
           tp.setLocation(x, y);
         }
 
-        Desktop.addInternalFrame(tp, treeTitle, w, h);
+        Desktop.addInternalFrame(tp, treeTitle, dim.width, dim.height);
       }
     } catch (Exception ex)
     {