JAL-1211 - pick up site-defined defined window geometry before we calculate layout
authorJim Procter <jprocter@dundee.ac.uk>
Fri, 4 Apr 2014 15:18:24 +0000 (16:18 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Fri, 4 Apr 2014 15:18:24 +0000 (16:18 +0100)
src/jalview/appletgui/AlignFrame.java

index 638a68f..51df8b9 100644 (file)
@@ -122,7 +122,28 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     {
       ex.printStackTrace();
     }
-
+    // need to get window geometry before we calculate alignment layout
+    if (applet != null)
+    {
+      String param;
+      try
+      {
+        param = applet.getParameter("windowWidth");
+        if (param != null)
+        {
+          int width = Integer.parseInt(param);
+          DEFAULT_WIDTH = width;
+        }
+        param = applet.getParameter("windowHeight");
+        if (param != null)
+        {
+          int height = Integer.parseInt(param);
+          DEFAULT_HEIGHT = height;
+        }
+      } catch (Exception ex)
+      {
+      }
+    }
     viewport = new AlignViewport(al, applet);
     alignPanel = new AlignmentPanel(this, viewport);
     avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
@@ -174,23 +195,6 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
         centreColumnLabelFlag.setState(true);
         centreColumnLabelFlag_stateChanged();
       }
-      try
-      {
-        param = applet.getParameter("windowWidth");
-        if (param != null)
-        {
-          int width = Integer.parseInt(param);
-          DEFAULT_WIDTH = width;
-        }
-        param = applet.getParameter("windowHeight");
-        if (param != null)
-        {
-          int height = Integer.parseInt(param);
-          DEFAULT_HEIGHT = height;
-        }
-      } catch (Exception ex)
-      {
-      }
 
     }
     if (viewport.getAlignment().isNucleotide())