public static MyDesktopPane getDesktopPane()
{
- return Desktop.getInstance().desktopPane;
+ Desktop desktop = Desktop.getInstance();
+ return desktop == null ? null : desktop.desktopPane;
}
- public StructureSelectionManager getStructureSelectionManager()
+ public static StructureSelectionManager getStructureSelectionManager()
{
return StructureSelectionManager
- .getStructureSelectionManager(this);
+ .getStructureSelectionManager(getInstance());
}
static int openFrameCount = 0;
private static int fileLoadingCount = 0;
- public JInternalFrame conservationSlider, PIDSlider;
+ public JInternalFrame conservationSlider;
+
+ public JInternalFrame PIDSlider;
/**
* just an instance (for testng, probably); no actual frames
*/
public static Desktop getInstance()
{
- return (Desktop) ApplicationSingletonProvider
- .getInstance(Desktop.class);
+ return Jalview.isHeadlessMode() ? null
+ : (Desktop) ApplicationSingletonProvider
+ .getInstance(Desktop.class);
}
/**
@SuppressWarnings("unused")
private Desktop()
{
+ try
+ {
/**
* A note to implementors. It is ESSENTIAL that any activities that might
* block are spawned off as threads rather than waited for during this
}
});
desktopPane.addMouseListener(ma);
+ } catch (Throwable t)
+ {
+ t.printStackTrace();
+ }
}
/**
public void doConfigureStructurePrefs()
{
// configure services
- StructureSelectionManager ssm = getStructureSelectionManager();
+ StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(this);
if (jalview.bin.Cache.getDefault(Preferences.ADD_SS_ANN, true))
{
ssm.setAddTempFacAnnot(jalview.bin.Cache
public static groovy.ui.Console getGroovyConsole()
{
- return Desktop.getInstance().groovyConsole;
+ Desktop desktop = Desktop.getInstance();
+ return desktop == null ? null : desktop.groovyConsole;
}
/**