use of org.freeplane.main.application.CommandLineParser.Options in project freeplane by freeplane.
the class SingleInstanceManager method start.
public void start(String[] args) {
final Options options = CommandLineParser.parse(args);
final String[] filesToLoad = options.getFilesToOpenAsArray();
if (isSingleInstanceMode && !options.hasMenuItemsToExecute()) {
initLockFile();
if (filesToLoad.length == 0 && !isSingleInstanceForceMode && checkIsMasterPresent()) {
isMasterPresent = true;
startStandAlone(filesToLoad);
} else if (!startAsSlave(filesToLoad)) {
if (!startAsMaster(filesToLoad)) {
startStandAlone(filesToLoad);
}
}
} else {
startStandAlone(filesToLoad);
}
}
use of org.freeplane.main.application.CommandLineParser.Options in project freeplane by freeplane.
the class FreeplaneGUIStarter method createFrame.
public void createFrame(final String[] args) {
Controller controller = Controller.getCurrentController();
ModeController modeController = controller.getModeController(MModeController.MODENAME);
controller.selectModeForBuild(modeController);
Compat.macMenuChanges();
new UserPropertiesUpdater().importOldDefaultStyle();
EventQueue.invokeLater(new Runnable() {
public void run() {
final Options options = CommandLineParser.parse(args);
viewController.init(Controller.getCurrentController());
splash.toBack();
final Frame frame = viewController.getFrame();
final int extendedState = frame.getExtendedState();
Container contentPane = viewController.getContentPane();
contentPane.setVisible(false);
splash.dispose();
splash = null;
frame.setVisible(true);
if (extendedState != frame.getExtendedState()) {
frame.setExtendedState(extendedState);
}
loadMaps(options.getFilesToOpenAsArray());
focusCurrentView();
viewController.getContentPane().setVisible(true);
frame.toFront();
startupFinished = true;
System.setProperty("nonInteractive", Boolean.toString(options.isNonInteractive()));
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
MenuUtils.executeMenuItems(options.getMenuItemsToExecute());
}
private void focusCurrentView() {
final MapView currentMapView = (MapView) Controller.getCurrentController().getMapViewManager().getMapViewComponent();
if (currentMapView != null) {
viewController.focusTo(currentMapView);
}
}
});
}
use of org.freeplane.main.application.CommandLineParser.Options in project freeplane by freeplane.
the class CommandLineParserTest method testFilesOnly.
@Test
public void testFilesOnly() {
final Options result = CommandLineParser.parse(someFiles);
assertEquals(Arrays.asList(someFiles), result.getFilesToOpen());
check(result, someFiles, emptyArray, false, false, false);
}
Aggregations