*/
public Desktop(boolean forInstance)
{
+
+ Cache.initLogger();
instanceOnly = true;
}
@SuppressWarnings("unused")
private Desktop()
{
+ Cache.initLogger();
try
{
/**
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);
}
/**
* 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)
{
// 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);
}
// 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;
}