changeset 6073:6216d402dc1b

Remove VBoxBuilder dependency from HelloSplitPane
author jgiles
date Mon, 13 Jan 2014 09:34:30 +1300
parents 399f574b5ab8
children e35db0874061
files apps/toys/Hello/src/main/java/hello/HelloSplitPane.java
diffstat 1 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/apps/toys/Hello/src/main/java/hello/HelloSplitPane.java	Fri Jan 10 15:05:56 2014 -0500
+++ b/apps/toys/Hello/src/main/java/hello/HelloSplitPane.java	Mon Jan 13 09:34:30 2014 +1300
@@ -30,7 +30,6 @@
 import javafx.beans.Observable;
 import javafx.event.EventHandler;
 import javafx.geometry.Orientation;
-import javafx.geometry.Pos;
 import javafx.scene.Group;
 import javafx.scene.Scene;
 import javafx.scene.control.Button;
@@ -39,7 +38,6 @@
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.HBox;
 import javafx.scene.layout.VBox;
-import javafx.scene.layout.VBoxBuilder;
 import javafx.scene.paint.Color;
 import javafx.stage.Stage;
 
@@ -69,8 +67,8 @@
         final Button l = new Button("Left Button");
         final Button r = new Button("Right Button");
         horizSplitPane.getItems().addAll(
-            VBoxBuilder.create().children(l).alignment(Pos.CENTER).build(),
-            VBoxBuilder.create().children(r).alignment(Pos.CENTER).build());
+                new VBox(l),
+                new VBox(r));
         horizSplitPane.getDividers().get(0).positionProperty().addListener(new InvalidationListener() {
             public void invalidated(Observable ov) {
                 horizSlider.setValue(horizSplitPane.getDividers().get(0).getPosition());
@@ -98,8 +96,8 @@
         final Button t = new Button("Top Button");
         final Button b = new Button("Bottom Button");
         vertSplitPane.getItems().addAll(
-            VBoxBuilder.create().children(t).alignment(Pos.CENTER).build(),
-            VBoxBuilder.create().children(b).alignment(Pos.CENTER).build());
+                new VBox(t),
+                new VBox(b));
         vertSplitPane.getDividers().get(0).positionProperty().addListener(new InvalidationListener() {
             public void invalidated(Observable ov) {                
                 vertSlider.setValue(1 - vertSplitPane.getDividers().get(0).getPosition());
@@ -122,18 +120,19 @@
         mailClient.setId("main-spt-pane");
         Button lbtn = new Button("hello");
         lbtn.setId("leftbtn");
-        mailClient.getItems().addAll(VBoxBuilder.create().children(lbtn).alignment(Pos.CENTER).build());
-        
+        mailClient.getItems().addAll(new VBox(lbtn));
+
         SplitPane rsp = new SplitPane();
         rsp.setId("right-spt-pane");
         rsp.setDividerPosition(0, 0.6f);
         rsp.setOrientation(Orientation.VERTICAL);
         Button tbtn = new Button("hello");
         tbtn.setId("right-topbtn");
-        rsp.getItems().addAll(VBoxBuilder.create().children(tbtn).alignment(Pos.CENTER).build());
+        rsp.getItems().addAll(new VBox(tbtn));
+
         Button bbtn = new Button("hello");
         bbtn.setId("right-bottombtn");
-        rsp.getItems().addAll(VBoxBuilder.create().children(bbtn).alignment(Pos.CENTER).build());
+        rsp.getItems().addAll(new VBox(bbtn));
         mailClient.getItems().addAll(rsp);
     }
 
@@ -157,11 +156,11 @@
         rsp.setOrientation(Orientation.VERTICAL);
         Button tbtn = new Button("hello");
         tbtn.setId("right-topbtn");
-        rsp.getItems().addAll(VBoxBuilder.create().children(tbtn).alignment(Pos.CENTER).build());
+        rsp.getItems().addAll(new VBox(tbtn));
 
         Button bbtn = new Button("hello");
         bbtn.setId("right-bottombtn");
-        rsp.getItems().addAll(VBoxBuilder.create().children(bbtn).alignment(Pos.CENTER).build());
+        rsp.getItems().addAll(new VBox(bbtn));
         mailClient2.getItems().addAll(rsp);
     }
 
@@ -172,7 +171,7 @@
 
         Button lbtn = new Button("hello");
         lbtn.setId("left-btn");
-        recursiveSplitPane.getItems().addAll(VBoxBuilder.create().children(lbtn).alignment(Pos.CENTER).build());
+        recursiveSplitPane.getItems().addAll(new VBox(lbtn));
 
         SplitPane sp = new SplitPane();
         sp.setId("right-split-pane");
@@ -180,7 +179,7 @@
         sp.setOrientation(Orientation.VERTICAL);
         Button rbtn = new Button("hello");
         rbtn.setId("right-top-btn");
-        sp.getItems().addAll(VBoxBuilder.create().children(rbtn).alignment(Pos.CENTER).build());
+        sp.getItems().addAll(new VBox(rbtn));
         SplitPane sv2 = new SplitPane();
         sv2.setId("right-bottom-split-pane");
         sp.getItems().addAll(sv2);