JAL-3253-applet adds NOMENUBAR, NOSTATUS, NOCALCULATION, SHOWOVERVIEW
[jalview.git] / src / jalview / gui / Desktop.java
index 2a972e3..957fb96 100644 (file)
@@ -864,7 +864,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);
+    addInternalFrame(frame, title, true, w, h, resizable, false, null);
   }
 
   /**
@@ -887,15 +887,51 @@ 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)
+          int w, int h, boolean resizable, boolean ignoreMinSize,
+          String name)
   {
 
+
     // TODO: allow callers to determine X and Y position of frame (eg. via
     // bounds object).
     // 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)
     {