Search in sources :

Example 1 with JFXStageRepresentation

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;
}
Also used : Shell(org.eclipse.swt.widgets.Shell) JFXStageRepresentation(org.csstudio.display.builder.representation.javafx.JFXStageRepresentation) Stage(javafx.stage.Stage) JFX_SWT_Wrapper(org.csstudio.javafx.swt.JFX_SWT_Wrapper)

Example 2 with JFXStageRepresentation

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;
}
Also used : JFXStageRepresentation(org.csstudio.display.builder.representation.javafx.JFXStageRepresentation) Parent(javafx.scene.Parent) Stage(javafx.stage.Stage)

Example 3 with JFXStageRepresentation

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());
}
Also used : JFXStageRepresentation(org.csstudio.display.builder.representation.javafx.JFXStageRepresentation)

Example 4 with JFXStageRepresentation

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();
    }
}
Also used : DisplayModel(org.csstudio.display.builder.model.DisplayModel) JFXStageRepresentation(org.csstudio.display.builder.representation.javafx.JFXStageRepresentation) Parent(javafx.scene.Parent)

Aggregations

JFXStageRepresentation (org.csstudio.display.builder.representation.javafx.JFXStageRepresentation)4 Parent (javafx.scene.Parent)2 Stage (javafx.stage.Stage)2 DisplayModel (org.csstudio.display.builder.model.DisplayModel)1 JFX_SWT_Wrapper (org.csstudio.javafx.swt.JFX_SWT_Wrapper)1 Shell (org.eclipse.swt.widgets.Shell)1