Search in sources :

Example 1 with PropertyPanel

use of org.csstudio.display.builder.editor.properties.PropertyPanel in project org.csstudio.display.builder by kasemir.

the class EditorDemoGUI method createElements.

private void createElements(final Stage stage) {
    editor = new DisplayEditor(toolkit, 50);
    tree = new WidgetTree(editor);
    property_panel = new PropertyPanel(editor);
    // Left: Widget tree
    Label header = new Label("Widgets");
    header.setMaxWidth(Double.MAX_VALUE);
    header.getStyleClass().add("header");
    final Control tree_control = tree.create();
    VBox.setVgrow(tree_control, Priority.ALWAYS);
    final VBox tree_box = new VBox(header, tree_control);
    // Center: Editor
    final Node editor_scene = editor.create();
    extendToolbar(editor.getToolBar());
    // Right: Properties
    header = new Label("Properties");
    header.setMaxWidth(Double.MAX_VALUE);
    header.getStyleClass().add("header");
    final VBox properties_box = new VBox(header, property_panel);
    final SplitPane center_split = new SplitPane(tree_box, editor_scene, properties_box);
    center_split.setDividerPositions(0.2, 0.8);
    final BorderPane layout = new BorderPane();
    layout.setCenter(center_split);
    BorderPane.setAlignment(center_split, Pos.TOP_LEFT);
    editor_scene.addEventFilter(MouseEvent.MOUSE_MOVED, mouse_tracker);
    layout.addEventFilter(KeyEvent.KEY_PRESSED, key_handler);
    stage.setTitle("Editor");
    stage.setWidth(1200);
    stage.setHeight(600);
    final Scene scene = new Scene(layout, 1200, 600);
    stage.setScene(scene);
    EditorUtil.setSceneStyle(scene);
    // If ScenicView.jar is added to classpath, open it here
    // ScenicView.show(scene);
    stage.show();
}
Also used : WidgetTree(org.csstudio.display.builder.editor.tree.WidgetTree) Control(javafx.scene.control.Control) BorderPane(javafx.scene.layout.BorderPane) Node(javafx.scene.Node) Label(javafx.scene.control.Label) SplitPane(javafx.scene.control.SplitPane) Scene(javafx.scene.Scene) VBox(javafx.scene.layout.VBox) PropertyPanel(org.csstudio.display.builder.editor.properties.PropertyPanel)

Aggregations

Node (javafx.scene.Node)1 Scene (javafx.scene.Scene)1 Control (javafx.scene.control.Control)1 Label (javafx.scene.control.Label)1 SplitPane (javafx.scene.control.SplitPane)1 BorderPane (javafx.scene.layout.BorderPane)1 VBox (javafx.scene.layout.VBox)1 PropertyPanel (org.csstudio.display.builder.editor.properties.PropertyPanel)1 WidgetTree (org.csstudio.display.builder.editor.tree.WidgetTree)1