// generally recommended
Runnable desktopInit = new Runnable() {
public void run() {
logger.fine("Initializing GUI");
MainWindow mainWindow = new MainWindow();
desktop = mainWindow;
mainWindow.initModule();
// Activate project - bind it to the desktop's project tree
MZmineProjectImpl currentProject = (MZmineProjectImpl) projectManager
.getCurrentProject();
currentProject.activateProject();
// add desktop menu icon
for (Class<?> moduleClass : MZmineModulesList.MODULES) {
MZmineModule module = initializedModules
.get(moduleClass);
if (module == null)
continue;
if (!(module instanceof MZmineProcessingModule))
continue;
mainWindow.getMainMenu().addMenuItemForModule(
(MZmineProcessingModule) module);
}
};
};