*/
public class Jalview
{
+
+ public Jalview()
+ {
+ setInstance(this);
+ }
+
static
{
Platform.getURLCommandArguments();
public static Jalview getInstance()
{
+ if (instance == null)
+ {
+ instance = new Jalview();
+ }
Jalview j;
@SuppressWarnings("unused")
ThreadGroup g = Thread.currentThread().getThreadGroup();
public static void main(String[] args)
{
// setLogging(); // BH - for event debugging in JavaScript
- setInstance(new Jalview());
+ new Jalview();
getInstance().doMain(args);
}
public static Desktop getInstance()
{
+ if (instance == null)
+ {
+ new Desktop(true);
+ }
Desktop d;
@SuppressWarnings("unused")
ThreadGroup g = Thread.currentThread().getThreadGroup();
public JInternalFrame conservationSlider, PIDSlider;
+ private boolean instanceOnly;
+
class MyDesktopManager implements DesktopManager
{
}
+ public Desktop(boolean forInstance)
+ {
+ instanceOnly = true;
+ setInstance(this);
+ }
/**
* Creates a new Desktop object.
*/
public Desktop()
{
- super();
/**
* A note to implementors. It is ESSENTIAL that any activities that might
* block are spawned off as threads rather than waited for during this
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
// IF JALVIEW IS RUNNING HEADLESS
// ///////////////////////////////////////////////
- if (getInstance() == null || Jalview.isHeadlessMode())
+ if (getInstance().instanceOnly || Jalview.isHeadlessMode())
{
return;
}
}
;
}
- if (getInstance() == null)
+ if (instanceOnly)
{
return;
}