use of org.csstudio.display.builder.editor.tree.WidgetTree 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();
}
Aggregations