JAL-1583 refactored addInternalFrame to allow webservice job frame to be added but...
[jalview.git] / src / jalview / gui / Desktop.java
index fea381d..b8f629a 100644 (file)
@@ -631,38 +631,85 @@ public class Desktop extends jalview.jbgui.GDesktop implements
    * Adds and opens the given frame to the desktop
    * 
    * @param frame
-   *          DOCUMENT ME!
+   *          Frame to show
    * @param title
-   *          DOCUMENT ME!
+   *          Visible Title
    * @param w
-   *          DOCUMENT ME!
+   *          width
    * @param h
-   *          DOCUMENT ME!
+   *          height
    */
   public static synchronized void addInternalFrame(
           final JInternalFrame frame, String title, int w, int h)
   {
-    addInternalFrame(frame, title, w, h, true);
+    addInternalFrame(frame, title, true, w, h, true);
   }
 
+
   /**
-   * DOCUMENT ME!
+   * Add an internal frame to the Jalview desktop
    * 
    * @param frame
-   *          DOCUMENT ME!
+   *          Frame to show
    * @param title
-   *          DOCUMENT ME!
+   *          Visible Title
+   * @param makeVisible
+   *          When true, display frame immediately, otherwise, caller must call
+   *          setVisible themselves.
    * @param w
-   *          DOCUMENT ME!
+   *          width
    * @param h
-   *          DOCUMENT ME!
+   *          height
+   */
+  public static synchronized void addInternalFrame(
+          final JInternalFrame frame, String title, boolean makeVisible,
+          int w, int h)
+  {
+    addInternalFrame(frame, title, makeVisible, w, h, true);
+  }
+
+  /**
+   * Add an internal frame to the Jalview desktop and make it visible
+   * 
+   * @param frame
+   *          Frame to show
+   * @param title
+   *          Visible Title
+   * @param w
+   *          width
+   * @param h
+   *          height
    * @param resizable
-   *          DOCUMENT ME!
+   *          Allow resize
    */
   public static synchronized void addInternalFrame(
           final JInternalFrame frame, String title, int w, int h,
           boolean resizable)
   {
+    addInternalFrame(frame, title, true, w, h, resizable);
+  }
+
+  /**
+   * 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
+   */
+  public static synchronized void addInternalFrame(
+          final JInternalFrame frame, String title, boolean makeVisible,
+          int w, int h, boolean resizable)
+  {
 
     // TODO: allow callers to determine X and Y position of frame (eg. via
     // bounds object).
@@ -687,7 +734,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
 
     openFrameCount++;
 
-    frame.setVisible(true);
+    frame.setVisible(makeVisible);
     frame.setClosable(true);
     frame.setResizable(resizable);
     frame.setMaximizable(resizable);