file
should point to a VisualSceneMaker project
directory.
// Get the singelton editor instance
final EditorInstance sEditor = EditorInstance.getInstance();
// Get an editor project from file
sEditor.openProject(file);
// Show the singelton editor instance
sEditor.setVisible(true);
file
should point to a VisualSceneMaker project
directory.
// Get an editor project from file
final RunTimeProject data = new RunTimeProject(file);
// Get the singelton runtime instance
final RunTimeInstance sRunTime = RunTimeInstance.getInstance();
// Launch the runtime with the project
if (sRunTime.launch(data)) {
// Start the runtime with the project
if (sRunTime.start(data)) {
// Wait until user aborts execution
System.err.println("Press Key To Abort ...");
// TODO: Stop waiting if execution
// has been aborted in another way
try {
final int in = System.in.read();
if (in != -1) {
// Aborting the execution now
}
} catch (final IOException exc) {
// Do nothing
} finally {
// Abort the runtime with the project
sRunTime.abort(data);
// Unload the project from the runtime
sRunTime.unload(data);
}
}
}
Compared to the editor mode, the project is registered
by sRunTime.launch(data)
in the VisualSceneMaker runtime
for execution. The (obvious) next step is to execute the project
by sRunTime.start(data)
. The projects ends if it gets
aborted sRunTime.abort(data)
. There are methods
to stop
, pause
and resume
(see API). In order to cleanup the project is
unregistered sRunTime.unload(data)
.