Search in sources :

Example 6 with JFX_SWT_Wrapper

use of org.csstudio.javafx.swt.JFX_SWT_Wrapper in project org.csstudio.display.builder by kasemir.

the class MacrosFieldEditor method getFXCanvas.

private void getFXCanvas(final Composite parent) {
    if (fxcanvas == null) {
        final JFX_SWT_Wrapper wrapper = new JFX_SWT_Wrapper(parent, () -> {
            table = new MacrosTable(new Macros());
            return new Scene(table.getNode());
        });
        fxcanvas = wrapper.getFXCanvas();
    }
}
Also used : JFX_SWT_Wrapper(org.csstudio.javafx.swt.JFX_SWT_Wrapper) Scene(javafx.scene.Scene) Macros(org.csstudio.display.builder.model.macros.Macros) MacrosTable(org.csstudio.display.builder.representation.javafx.MacrosTable)

Example 7 with JFX_SWT_Wrapper

use of org.csstudio.javafx.swt.JFX_SWT_Wrapper in project org.csstudio.display.builder by kasemir.

the class PropertyPage method createControl.

@Override
public void createControl(final Composite parent) {
    final JFX_SWT_Wrapper wrapper = new JFX_SWT_Wrapper(parent, () -> {
        // StackPane w/ panel as single child to 'fill' the available space.
        final StackPane root = new StackPane(property_panel);
        final Scene scene = new Scene(root, 200.0, 400.0);
        EditorUtil.setSceneStyle(scene);
        return scene;
    });
    canvas = wrapper.getFXCanvas();
}
Also used : JFX_SWT_Wrapper(org.csstudio.javafx.swt.JFX_SWT_Wrapper) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 8 with JFX_SWT_Wrapper

use of org.csstudio.javafx.swt.JFX_SWT_Wrapper 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();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) DisplayModel(org.csstudio.display.builder.model.DisplayModel) Parent(javafx.scene.Parent) JFXRepresentation(org.csstudio.display.builder.representation.javafx.JFXRepresentation) FillLayout(org.eclipse.swt.layout.FillLayout) JFX_SWT_Wrapper(org.csstudio.javafx.swt.JFX_SWT_Wrapper) Scene(javafx.scene.Scene) Display(org.eclipse.swt.widgets.Display)

Example 9 with JFX_SWT_Wrapper

use of org.csstudio.javafx.swt.JFX_SWT_Wrapper in project org.csstudio.display.builder by kasemir.

the class ZoomPanJavaFXinSWT method main.

public static void main(String[] args) throws Exception {
    final Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setText("Zoom Pan Demo");
    shell.setLayout(new FillLayout());
    final JFX_SWT_Wrapper wrapper = new JFX_SWT_Wrapper(shell, () -> ZoomPan.createScene());
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) FillLayout(org.eclipse.swt.layout.FillLayout) JFX_SWT_Wrapper(org.csstudio.javafx.swt.JFX_SWT_Wrapper) Display(org.eclipse.swt.widgets.Display)

Example 10 with JFX_SWT_Wrapper

use of org.csstudio.javafx.swt.JFX_SWT_Wrapper in project org.csstudio.display.builder by kasemir.

the class DragDropDemoJFXinSWT method main.

@SuppressWarnings("nls")
public static void main(String[] args) throws Exception {
    final Display display = new Display();
    final Shell shell = new Shell(display);
    shell.setText("Drag Drop Demo");
    shell.setLayout(new FillLayout());
    final JFX_SWT_Wrapper wrapper = new JFX_SWT_Wrapper(shell, () -> DragDropDemo.createScene());
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}
Also used : Shell(org.eclipse.swt.widgets.Shell) FillLayout(org.eclipse.swt.layout.FillLayout) JFX_SWT_Wrapper(org.csstudio.javafx.swt.JFX_SWT_Wrapper) Display(org.eclipse.swt.widgets.Display)

Aggregations

JFX_SWT_Wrapper (org.csstudio.javafx.swt.JFX_SWT_Wrapper)11 Scene (javafx.scene.Scene)8 FillLayout (org.eclipse.swt.layout.FillLayout)5 Shell (org.eclipse.swt.widgets.Shell)4 Parent (javafx.scene.Parent)3 Control (org.eclipse.swt.widgets.Control)3 Display (org.eclipse.swt.widgets.Display)3 StackPane (javafx.scene.layout.StackPane)2 ModelBasedPlot (org.csstudio.trends.databrowser3.ui.ModelBasedPlot)2 Label (javafx.scene.control.Label)1 Stage (javafx.stage.Stage)1 DisplayEditor (org.csstudio.display.builder.editor.DisplayEditor)1 ExecuteDisplayButton (org.csstudio.display.builder.editor.rcp.actions.ExecuteDisplayButton)1 DisplayModel (org.csstudio.display.builder.model.DisplayModel)1 Macros (org.csstudio.display.builder.model.macros.Macros)1 AutocompleteMenu (org.csstudio.display.builder.representation.javafx.AutocompleteMenu)1 JFXRepresentation (org.csstudio.display.builder.representation.javafx.JFXRepresentation)1 JFXStageRepresentation (org.csstudio.display.builder.representation.javafx.JFXStageRepresentation)1 MacrosTable (org.csstudio.display.builder.representation.javafx.MacrosTable)1 RTValuePlot (org.csstudio.javafx.rtplot.RTValuePlot)1