JAL-3253-applet JAL-3424 headless fix for Windows
[jalview.git] / src / jalview / gui / Desktop.java
index 957fb96..ace7529 100644 (file)
@@ -378,6 +378,8 @@ public class Desktop extends GDesktop
    */
   public Desktop(boolean forInstance)
   {
+
+    Cache.initLogger();
     instanceOnly = true;
   }
   
@@ -388,6 +390,7 @@ public class Desktop extends GDesktop
   @SuppressWarnings("unused")
   private Desktop()
   {
+    Cache.initLogger();
     try
     {
     /**
@@ -864,7 +867,7 @@ public class Desktop extends GDesktop
           final JInternalFrame frame, String title, int w, int h,
           boolean resizable)
   {
-    addInternalFrame(frame, title, true, w, h, resizable, false, null);
+    addInternalFrame(frame, title, true, w, h, resizable, false);
   }
 
   /**
@@ -887,38 +890,8 @@ public class Desktop extends GDesktop
    *          Do not set the default minimum size for frame
    */
   public static synchronized void addInternalFrame(
-          JInternalFrame frame, String title, boolean makeVisible, int w,
-          int h, boolean resizable, boolean ignoreMinSize)
-  {
-    addInternalFrame(frame, title, makeVisible, w, h, resizable,
-            ignoreMinSize, null);
-  }
-
-  /**
-   * Add an internal frame to the Jalview desktop
-   * 
-   * @param frame
-   *          Frame to show
-   * @param title
-   *          Visible Title
-   * @param makeVisible
-   *          When true, display frame immediately, otherwise, caller must call
-   *          setVisible themselves.
-   * @param w
-   *          width
-   * @param h
-   *          height
-   * @param resizable
-   *          Allow resize
-   * @param ignoreMinSize
-   *          Do not set the default minimum size for frame
-   * @param name
-   *          for HTML div embedding
-   */
-  public static synchronized void addInternalFrame(
           final JInternalFrame frame, String title, boolean makeVisible,
-          int w, int h, boolean resizable, boolean ignoreMinSize,
-          String name)
+          int w, int h, boolean resizable, boolean ignoreMinSize)
   {
 
 
@@ -927,13 +900,8 @@ public class Desktop extends GDesktop
     // TODO: consider fixing method to update entries in the window submenu with
     // the current window title
 
-    if (name != null)
-    {
-      frame.setName(Jalview.getAppID(name));
-    }
-
     frame.setTitle(title);
-    if (frame.getWidth() < 1 || frame.getHeight() < 1)
+    if (w > 0 && (frame.getWidth() < 1 || frame.getHeight() < 1))
     {
       frame.setSize(w, h);
     }
@@ -941,7 +909,7 @@ public class Desktop extends GDesktop
     // A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
     // IF JALVIEW IS RUNNING HEADLESS
     // ///////////////////////////////////////////////
-    if (Desktop.getInstance().instanceOnly || Jalview.isHeadlessMode())
+    if (Jalview.isHeadlessMode() || Desktop.getInstance().instanceOnly)
     {
       return;
     }