use of org.csstudio.display.builder.representation.javafx.JFXRepresentation in project org.csstudio.display.builder by kasemir.
the class RepresentationDemoJavaFXinSWT method main.
public static void main(final String[] args) throws Exception {
// final DisplayModel model = ExampleModels.getModel(1);
final DisplayModel model = ExampleModels.createModel();
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setText(model.getPropertyValue(propName));
shell.setLayout(new FillLayout());
final JFX_SWT_Wrapper wrapper = new JFX_SWT_Wrapper(shell, () -> {
toolkit = new JFXRepresentation(false);
return new Scene(toolkit.createModelRoot());
});
final Scene scene = wrapper.getScene();
JFXRepresentation.setSceneStyle(scene);
final Parent parent = toolkit.getModelParent();
toolkit.representModel(parent, model);
final DummyRuntime runtime = new DummyRuntime(model);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
runtime.shutdown();
toolkit.shutdown();
display.dispose();
}
use of org.csstudio.display.builder.representation.javafx.JFXRepresentation in project org.csstudio.display.builder by kasemir.
the class RepresentationDemoJavaFX method close.
public void close(final DisplayModel model) {
final JFXRepresentation toolkit = model.getUserData(DisplayModel.USER_DATA_TOOLKIT);
toolkit.disposeRepresentation(model);
}
Aggregations