Commit bb685e21 authored by legoc's avatar legoc
Browse files

Added SplitPane to separate the 3D scene and the tree view

parent c5142824
......@@ -47,6 +47,7 @@ import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeView;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.BorderPane;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.paint.PhongMaterial;
......@@ -183,19 +184,25 @@ public class Nomad3DEditor extends Application {
// ---------------
StackPane subScenePane = new StackPane(subScene);
subScenePane.setPrefSize(subScene.getWidth(), subScene.getHeight());
subScene.setManaged(false);
subScene.widthProperty().bind(subScenePane.widthProperty());
subScene.heightProperty().bind(subScenePane.heightProperty());
TreeView<Component> hierarchyView = buildHierarchyView();
pane = new BorderPane();
pane.setCenter(subScenePane);
SplitPane splitPane = new SplitPane();
splitPane.getItems().addAll(hierarchyView, subScenePane);
splitPane.setDividerPosition(0, 0.3);
pane.setCenter(splitPane);
pane.setTop(buildMenuBar());
pane.setLeft(hierarchyView);
scene = new Scene(pane);
scene.setFill(Color.WHITE);
buildEventHandlers(null);
} else {
scene = loadScene(initialModelPath);
}
......@@ -377,6 +384,7 @@ public class Nomad3DEditor extends Application {
subScene.setFill(Color.color(0.5, 0.55, 0.65));
StackPane subScenePane = new StackPane(subScene);
subScenePane.setPrefSize(subScene.getWidth(), subScene.getHeight());
subScene.setManaged(false);
subScene.widthProperty().bind(subScenePane.widthProperty());
subScene.heightProperty().bind(subScenePane.heightProperty());
......@@ -388,11 +396,14 @@ public class Nomad3DEditor extends Application {
TreeView<Component> hierarchyView = buildHierarchyView();
this.pane = new BorderPane();
SplitPane splitPane = new SplitPane();
splitPane.getItems().addAll(hierarchyView, subScenePane);
splitPane.setDividerPosition(0, 0.3);
pane.setCenter(splitPane);
pane.setTop(buildMenuBar());
pane.setCenter(subScenePane);
pane.setLeft(hierarchyView);
this.scene = new Scene(pane);
scene.setFill(Color.WHITE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment