use of org.csstudio.display.builder.representation.javafx.JFXStageRepresentation in project org.csstudio.display.builder by kasemir.
the class RuntimeApplication method initializeUI.
private Stage initializeUI() {
// TODO Load named color, font configs
// Creating an FX Canvas results in a combined
// SWT and JavaFX setup with common UI thread.
// Shell that's created as a parent for the FX Canvas is never shown.
display = Display.getDefault();
final Shell temp_shell = new Shell(display);
new JFX_SWT_Wrapper(temp_shell, () -> null);
temp_shell.close();
final Stage stage = new Stage();
stage.setTitle("Display Runtime");
stage.setWidth(600);
stage.setHeight(400);
stage.show();
toolkit = new JFXStageRepresentation(stage);
RuntimeUtil.hookRepresentationListener(toolkit);
return stage;
}
use of org.csstudio.display.builder.representation.javafx.JFXStageRepresentation in project org.csstudio.display.builder by kasemir.
the class RCP_JFXRepresentation method openStandaloneWindow.
@Override
public ToolkitRepresentation<Parent, Node> openStandaloneWindow(final DisplayModel model, final Consumer<DisplayModel> close_handler) throws Exception {
final Stage stage = new Stage();
final JFXStageRepresentation toolkit = new JFXStageRepresentation(stage);
final Parent root = toolkit.configureStage(model, close_handler);
stage.show();
toolkit.representModel(root, model);
return toolkit;
}
use of org.csstudio.display.builder.representation.javafx.JFXStageRepresentation in project org.csstudio.display.builder by kasemir.
the class RuntimeDemoJavaFX method start.
/**
* JavaFX Start
*/
@Override
public void start(final Stage stage) {
toolkit = new JFXStageRepresentation(stage);
RuntimeUtil.hookRepresentationListener(toolkit);
// Load model in background
RuntimeUtil.getExecutor().execute(() -> loadModel());
}
use of org.csstudio.display.builder.representation.javafx.JFXStageRepresentation in project org.csstudio.display.builder by kasemir.
the class RepresentationDemoJavaFX method start.
@Override
public void start(final Stage stage) {
try {
final DisplayModel model = ExampleModels.createModel();
final JFXStageRepresentation toolkit = new JFXStageRepresentation(stage);
final Parent parent = toolkit.configureStage(model, this::close);
toolkit.representModel(parent, model);
runtime = new DummyRuntime(model);
} catch (final Exception ex) {
ex.printStackTrace();
Platform.exit();
}
}
Aggregations