Commits

shemnon committed 9254448

get rid of the builders

Comments (0)

Files changed (8)

src/main/java/com/github/shemnon/deckcontrol/skin/FadeDeckSkin.java

 package com.github.shemnon.deckcontrol.skin;
 
 import com.github.shemnon.deckcontrol.Deck;
-import javafx.animation.FadeTransitionBuilder;
+import javafx.animation.FadeTransition;
 import javafx.beans.value.ChangeListener;
 import javafx.scene.Node;
 import javafx.util.Duration;
             if (currentNode != null) {
                 currentNode.setOpacity(0.0);
                 currentNode.setVisible(true);
-                FadeTransitionBuilder.create()
-                        .node(currentNode)
-                        .fromValue(0.0)
-                        .toValue(1.0)
-                        .duration(Duration.seconds(1))
-                        .build()
-                        .play();
+                FadeTransition fade = new FadeTransition(Duration.seconds(1), currentNode);
+                fade.setFromValue(0.0);
+                fade.setToValue(1.0);
+                fade.play();
             }
             if (oldNode != null) {
                 // slide last slide to left
-                FadeTransitionBuilder.create()
-                        .node(oldNode)
-                        .toValue(0.0)
-                        .duration(Duration.seconds(1))
-                        .onFinished(actionEvent -> {
-                            oldNode.setVisible(false);
-                            oldNode.setOpacity(1.0);
-                        })
-                        .build()
-                        .play();
+                FadeTransition fade = new FadeTransition(Duration.seconds(1), oldNode);
+                fade.setToValue(0.0);
+                fade.setOnFinished(actionEvent -> {
+                    oldNode.setVisible(false);
+                    oldNode.setOpacity(1.0);}
+                );
+                fade.play();
             }
         }
     }

src/main/java/com/github/shemnon/deckcontrol/skin/PileDeckSkin.java

     private int shownIndex;
     SequentialTransition sequentialTransition;
 
-    double maxWidth, maxHeight;
-
     StyleableDoubleProperty spreadAngle;
 
     public PileDeckSkin(final Deck deck) {
                 node.setScaleY(4.0);
                 node.setScaleZ(4.0);
                 node.setVisible(true);
-                transitions.add(
-                        new ParallelTransition(
-                                FadeTransitionBuilder.create()
-                                    .toValue(1.0)
-                                    .node(node)
-                                    .duration(duration)
-                                    .build(),
-                                ScaleTransitionBuilder.create()
-                                    .fromX(4.0).fromY(4.0).fromZ(4.0)
-                                    .toX(1.0).toY(1.0).toZ(1.0)
-                                    .node(node)
-                                    .duration(duration)
-                                    .build()
-                        )
-                );
 
+                FadeTransition fade = new FadeTransition(duration, node);
+                fade.setToValue(1.0);
+
+                ScaleTransition scale = new ScaleTransition(duration, node);
+                scale.setFromX(4.0);
+                scale.setFromY(4.0);
+                scale.setFromZ(4.0);
+                scale.setToX(1.0);
+                scale.setToY(1.0);
+                scale.setToZ(1.0);
+
+                transitions.add(new ParallelTransition(fade, scale));
             }
         } else if (lastIndex > shownIndex) {
             // flop cards out
                 node.setScaleY(1.0);
                 node.setScaleZ(1.0);
                 node.setVisible(true);
-                transitions.add(
-                        new ParallelTransition(
-                                FadeTransitionBuilder.create()
-                                        .fromValue(1.0)
-                                        .toValue(0.0)
-                                        .onFinished(actionEvent -> node.setVisible(false))
-                                        .node(node)
-                                        .duration(duration)
-                                        .build(),
-                                ScaleTransitionBuilder.create()
-                                        .fromX(1.0).fromY(1.0).fromZ(1.0)
-                                        .toX(4.0).toY(4.0).toZ(4.0)
-                                        .node(node)
-                                        .duration(duration)
-                                        .build()
-                        )
-                );
+
+                FadeTransition fade = new FadeTransition(duration, node);
+                fade.setFromValue(1.0);
+                fade.setToValue(0.0);
+                fade.setOnFinished(actionEvent -> node.setVisible(false));
+
+                ScaleTransition scale = new ScaleTransition(duration, node);
+                scale.setFromX(1.0);
+                scale.setFromY(1.0);
+                scale.setFromZ(1.0);
+                scale.setToX(4.0);
+                scale.setToY(4.0);
+                scale.setToZ(4.0);
+
+                transitions.add(new ParallelTransition(fade, scale));
             }
         }
 

src/main/java/com/github/shemnon/deckcontrol/skin/ShiftDeckSkin.java

 package com.github.shemnon.deckcontrol.skin;
 
 import com.github.shemnon.deckcontrol.Deck;
-import javafx.animation.Animation;
-import javafx.animation.ParallelTransition;
-import javafx.animation.SequentialTransition;
-import javafx.animation.TranslateTransitionBuilder;
+import javafx.animation.*;
 import javafx.beans.value.ChangeListener;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
         } else if (lastIndex < shownIndex) {
             if (oldNode != null) {
                 // slide last slide to left
-                transition.getChildren().add(
-                        TranslateTransitionBuilder.create()
-                                .node(oldNode)
-                                .fromX(0)
-                                .toX(-deck.getWidth())
-                                .duration(Duration.seconds(1))
-                                .onFinished(hideOldNode)
-                                .build());
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), oldNode);
+                translate.setFromX(0);
+                translate.setToX(-deck.getWidth());
+                translate.setOnFinished(hideOldNode);
+
+                transition.getChildren().add(translate);
             }
             if (currentNode != null) {
                 // slide next slide from right
                 currentNode.setTranslateX(deck.getWidth());
                 currentNode.setVisible(true);
-                transition.getChildren().add(
-                        TranslateTransitionBuilder.create()
-                            .node(currentNode)
-                            .fromX(deck.getWidth())
-                            .toX(0)
-                            .duration(Duration.seconds(1))
-                            .build());
+
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), currentNode);
+                translate.setFromX(deck.getWidth());
+                translate.setToX(0);
+
+                transition.getChildren().add(translate);
             }
         } else {
             if (oldNode != null) {
                 // slide last slide to right
-                transition.getChildren().add(
-                        TranslateTransitionBuilder.create()
-                            .node(oldNode)
-                            .fromX(0)
-                            .toX(deck.getWidth())
-                            .duration(Duration.seconds(1))
-                            .onFinished(hideOldNode)
-                            .build());
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), oldNode);
+                translate.setFromX(0);
+                translate.setToX(-deck.getWidth());
+                translate.setOnFinished(hideOldNode);
+
+                transition.getChildren().add(translate);
             }
             if (currentNode != null) {
                 // slide next slide from left
                 currentNode.setTranslateX(-deck.getWidth());
                 currentNode.setVisible(true);
-                transition.getChildren().add(
-                        TranslateTransitionBuilder.create()
-                            .node(currentNode)
-                            .fromX(-deck.getWidth())
-                            .toX(0)
-                            .duration(Duration.seconds(1))
-                            .build());
+
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), currentNode);
+                translate.setFromX(-deck.getWidth());
+                translate.setToX(0);
+
+                transition.getChildren().add(translate);
             }
         }
         if (sequentialTransition.getStatus() == Animation.Status.RUNNING) {

src/main/java/com/github/shemnon/deckcontrol/skin/SlideDeckSkin.java

 package com.github.shemnon.deckcontrol.skin;
 
 import com.github.shemnon.deckcontrol.Deck;
-import javafx.animation.TranslateTransitionBuilder;
+import javafx.animation.TranslateTransition;
 import javafx.beans.value.ChangeListener;
 import javafx.event.ActionEvent;
 import javafx.event.EventHandler;
 
     private ChangeListener<Number> selectedIndexListener;
 
-    public SlideDeckSkin (final Deck deck) {
+    public SlideDeckSkin(final Deck deck) {
         super(deck);
         shownIndex = deck.getPrimaryNodeIndex();
         addListeners();
                 // slide next slide from right
                 currentNode.setTranslateX(deck.getWidth());
                 currentNode.setVisible(true);
-                TranslateTransitionBuilder.create()
-                        .node(currentNode)
-                        .fromX(deck.getWidth())
-                        .toX(0)
-                        .duration(Duration.seconds(1))
-                        .onFinished(hideOldNode)
-                        .build()
-                        .play();
+
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), currentNode);
+                translate.setFromX(deck.getWidth());
+                translate.setToX(0);
+                translate.setOnFinished(hideOldNode);
+
+                translate.play();
             } else {
                 // slide last slide to left
-                TranslateTransitionBuilder.create()
-                        .node(hideNode)
-                        .fromX(0)
-                        .toX(-deck.getWidth())
-                        .duration(Duration.seconds(1))
-                        .onFinished(hideOldNode)
-                        .build()
-                        .play();
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), hideNode);
+                translate.setFromX(0);
+                translate.setToX(-deck.getWidth());
+                translate.setOnFinished(hideOldNode);
+
+                translate.play();
             }
         } else {
             if (hideNode != null) {
                     currentNode.setTranslateX(0);
                     currentNode.setVisible(true);
                 }
-                TranslateTransitionBuilder.create()
-                        .node(hideNode)
-                        .fromX(0)
-                        .toX(deck.getWidth())
-                        .duration(Duration.seconds(1))
-                        .onFinished(hideOldNode)
-                        .build()
-                        .play();
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), hideNode);
+                translate.setFromX(0);
+                translate.setToX(deck.getWidth());
+                translate.setOnFinished(hideOldNode);
+
+                translate.play();
             } else {
                 // slide current slide from left
                 currentNode.setTranslateX(-deck.getWidth());
                 currentNode.setVisible(true);
-                TranslateTransitionBuilder.create()
-                        .node(currentNode)
-                        .fromX(-deck.getWidth())
-                        .toX(0)
-                        .duration(Duration.seconds(1))
-                        .onFinished(hideOldNode)
-                        .build()
-                        .play();
+
+                TranslateTransition translate = new TranslateTransition(Duration.seconds(1), currentNode);
+                translate.setFromX(-deck.getWidth());
+                translate.setToX(0);
+                translate.setOnFinished(hideOldNode);
+
+                translate.play();
             }
         }
     }

src/test/java/com/github/shemnon/deckcontrol/DemoOne.java

 
 import javafx.application.Application;
 import javafx.scene.Node;
-import javafx.scene.SceneBuilder;
-import javafx.scene.control.ButtonBuilder;
-import javafx.scene.layout.HBoxBuilder;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.layout.HBox;
 import javafx.scene.layout.Pane;
 import javafx.scene.layout.StackPane;
-import javafx.scene.layout.VBoxBuilder;
+import javafx.scene.layout.VBox;
 import javafx.scene.text.Text;
 import javafx.stage.Stage;
 
     public void start(Stage stage) throws Exception {
         final Deck deck = createDeck();
 
-        stage.setScene(SceneBuilder.create()
-                .root(
-                        VBoxBuilder.create()
-                                .fillWidth(false)
-                                .children(
-                                        deck,
-                                        HBoxBuilder.create().children(
-                                                ButtonBuilder.create()
-                                                        .text("<<")
-                                                        .onAction(actionEvent -> deck.previousNode()).build(),
-                                                ButtonBuilder.create()
-                                                        .text(">>")
-                                                        .onAction(actionEvent -> deck.nextNode()).build()
-                                        ).build(),
-                                        HBoxBuilder.create().children(
-                                                ButtonBuilder.create()
-                                                        .text("Slide")
-                                                        .onAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.SlideDeckSkin'")).build(),
-                                                ButtonBuilder.create()
-                                                        .text("Fade")
-                                                        .onAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.FadeDeckSkin'")).build(),
-                                                ButtonBuilder.create()
-                                                        .text("Shift")
-                                                        .onAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.ShiftDeckSkin'")).build(),
-                                                ButtonBuilder.create()
-                                                        .text("Shelf")
-                                                        .onAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.ShelfDeckSkin'")).build()
-                                        ).build()
-                                ).build())
-                .width(300)
-                .height(300)
-                .build());
+        Button left = new Button("<<");
+        left.setOnAction(actionEvent -> deck.previousNode());
+        Button right = new Button(">>");
+        right.setOnAction(actionEvent -> deck.nextNode());
 
+        Button slide = new Button("Slide");
+        slide.setOnAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.SlideDeckSkin'"));
+        Button fade = new Button("Fade");
+        fade.setOnAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.FadeDeckSkin'"));
+        Button shift = new Button("Shift");
+        shift.setOnAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.ShiftDeckSkin'"));
+        Button shelf = new Button("Shelf");
+        shelf.setOnAction(actionEvent -> deck.setStyle("-fx-skin: 'com.github.shemnon.deckcontrol.skin.ShelfDeckSkin'"));
 
-        stage.setWidth(300);
-        stage.setHeight(300);
+        VBox box = new VBox(
+                deck,
+                new HBox(left, right),
+                new HBox(slide, fade, shift, shelf)
+        );
+        box.setFillWidth(false);
+        box.setPrefWidth(300);
+        box.setPrefHeight(300);
+
+        Scene scene = new Scene(box);
+        stage.setScene(scene);
 
         stage.show();
     }

src/test/java/com/github/shemnon/deckcontrol/DemoThree.java

 import javafx.application.Application;
 import javafx.collections.ObservableList;
 import javafx.scene.Node;
-import javafx.scene.SceneBuilder;
+import javafx.scene.Scene;
 import javafx.scene.control.Button;
 import javafx.scene.control.Slider;
-import javafx.scene.control.SliderBuilder;
-import javafx.scene.layout.HBoxBuilder;
 import javafx.scene.layout.Pane;
 import javafx.scene.layout.StackPane;
-import javafx.scene.layout.VBoxBuilder;
+import javafx.scene.layout.VBox;
 import javafx.stage.Stage;
 import javafx.util.Duration;
 
             timeline.play();
         });
 
-        Slider slider;
-        stage.setScene(SceneBuilder.create()
-                .root(
-                        VBoxBuilder.create()
-                                .fillWidth(false)
-                                .children(
-                                        spinPane,
-                                        HBoxBuilder.create().children(
-                                                slider = SliderBuilder.create()
-                                                        .min(-360)
-                                                        .max(360)
-                                                        .value(90)
-                                                        .build()
-                                        ).build(),
-                                        flipPane,
-                                        flipButton
-                                ).build())
-                .width(300)
-                .height(300)
-                .build());
+        Slider slider = new Slider(-360, 360, 90);
         slider.valueProperty().addListener((observableValue, oldValue, newValue) -> spinPane.setAngle(newValue.doubleValue()));
 
+        VBox vbox = new VBox(spinPane, slider, flipPane, flipButton);
+        vbox.setFillWidth(false);
+        vbox.setPrefWidth(300);
+        vbox.setPrefHeight(300);
+
+        stage.setScene(new Scene(vbox));
+
         stage.setWidth(300);
         stage.setHeight(300);
 

src/test/java/com/github/shemnon/deckcontrol/DemoTwo.java

  */
 package com.github.shemnon.deckcontrol;
 
-import com.javafx.experiments.scenicview.ScenicView;
 import javafx.application.Application;
 import javafx.collections.FXCollections;
 import javafx.geometry.Pos;
 import javafx.scene.Node;
-import javafx.scene.SceneBuilder;
+import javafx.scene.Scene;
 import javafx.scene.control.*;
-import javafx.scene.layout.HBoxBuilder;
+import javafx.scene.layout.HBox;
 import javafx.scene.layout.Pane;
 import javafx.scene.layout.StackPane;
-import javafx.scene.layout.VBoxBuilder;
+import javafx.scene.layout.VBox;
 import javafx.scene.text.Text;
 import javafx.stage.Stage;
 
         final Deck deck = createDeck();
         final ToggleGroup alignGroup = new ToggleGroup();
 
-        final ComboBox<String> cssCombo;
-
-        stage.setScene(SceneBuilder.create()
-                .root(
-                        VBoxBuilder.create()
-                                .fillWidth(false)
-                                .children(new Node[]{deck, HBoxBuilder.create().children(
-                                        ButtonBuilder.create()
-                                                .text("<<")
-                                                .onAction(actionEvent -> deck.previousNode()).build(),
-                                        ButtonBuilder.create()
-                                                .text(">>")
-                                                .onAction(actionEvent -> deck.nextNode()).build()
-                                ).build(), cssCombo = ComboBoxBuilder.create(String.class)
-                                        .items(FXCollections.observableArrayList(
-                                                "Slide.css",
-                                                "Pile.css",
-                                                "Shift.css",
-                                                "Fade.css",
-                                                "Shelf.css",
-                                                "ShelfFlat.css",
-                                                "ShelfTight.css",
-                                                "ShelfInverse.css"
-                                        ))
-                                        .editable(true)
-                                        .build(), HBoxBuilder.create().children(
-                                        ToggleButtonBuilder.create()
-                                                .text("NW")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.TOP_LEFT)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("N")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.TOP_CENTER)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("NE")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.TOP_RIGHT)).build()
-                                ).build(), HBoxBuilder.create().children(
-                                        ToggleButtonBuilder.create()
-                                                .text("W")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.CENTER_LEFT)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("C")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.CENTER)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("E")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.CENTER_RIGHT)).build()
-                                ).build(), HBoxBuilder.create().children(
-                                        ToggleButtonBuilder.create()
-                                                .text("BW")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.BASELINE_LEFT)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("B")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.BASELINE_CENTER)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("BE")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.BASELINE_RIGHT)).build()
-                                ).build(), HBoxBuilder.create().children(
-                                        ToggleButtonBuilder.create()
-                                                .text("SW")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.BOTTOM_LEFT)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("S")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.BOTTOM_CENTER)).build(),
-                                        ToggleButtonBuilder.create()
-                                                .text("SE")
-                                                .toggleGroup(alignGroup)
-                                                .onAction(actionEvent -> deck.setAlignment(Pos.BOTTOM_RIGHT)).build()
-                                ).build(), HBoxBuilder.create().children(
-                                        ToggleButtonBuilder.create()
-                                                .text("Fill")
-                                                .toggleGroup(alignGroup)
-                                                .selected(true)
-                                                .onAction(actionEvent -> deck.setAlignment(null)).build(),
-                                        ButtonBuilder.create()
-                                                .text("ScenicView")
-                                                .onAction(actionEvent -> ScenicView.show(stage.getScene())).build()
-                                ).build()}).build())
-                .width(350)
-                .height(350)
-                .build());
 
+        Button left = new Button("<<");
+        left.setOnAction(actionEvent -> deck.previousNode());
+        Button right = new Button(">>");
+        right.setOnAction(actionEvent -> deck.nextNode());
+
+        ComboBox<String> cssCombo = new ComboBox<>(FXCollections.observableArrayList(
+                "Slide.css",
+                "Pile.css",
+                "Shift.css",
+                "Fade.css",
+                "Shelf.css",
+                "ShelfFlat.css",
+                "ShelfTight.css",
+                "ShelfInverse.css"
+        ));
+        cssCombo.setEditable(true);
         cssCombo.getSelectionModel().selectedItemProperty().addListener((observableValue, oldStyle, newStyle) ->
-            stage.getScene().getStylesheets().setAll(newStyle)
+                stage.getScene().getStylesheets().setAll(newStyle)
         );
-        cssCombo.getSelectionModel().selectFirst();
+
+
+        ToggleButton nw = new ToggleButton("NW");
+        nw.setToggleGroup(alignGroup);
+        nw.setOnAction(actionEvent -> deck.setAlignment(Pos.TOP_LEFT));
+        ToggleButton n = new ToggleButton("N");
+        n.setToggleGroup(alignGroup);
+        n.setOnAction(actionEvent -> deck.setAlignment(Pos.TOP_CENTER));
+        ToggleButton ne = new ToggleButton("NE");
+        ne.setToggleGroup(alignGroup);
+        ne.setOnAction(actionEvent -> deck.setAlignment(Pos.TOP_RIGHT));
+
+        ToggleButton w = new ToggleButton("W");
+        w.setToggleGroup(alignGroup);
+        w.setOnAction(actionEvent -> deck.setAlignment(Pos.CENTER_LEFT));
+        ToggleButton c = new ToggleButton("C");
+        c.setToggleGroup(alignGroup);
+        c.setOnAction(actionEvent -> deck.setAlignment(Pos.CENTER));
+        ToggleButton e = new ToggleButton("E");
+        e.setToggleGroup(alignGroup);
+        e.setOnAction(actionEvent -> deck.setAlignment(Pos.CENTER_RIGHT));
+
+        ToggleButton bw = new ToggleButton("BW");
+        bw.setToggleGroup(alignGroup);
+        bw.setOnAction(actionEvent -> deck.setAlignment(Pos.BASELINE_LEFT));
+        ToggleButton b = new ToggleButton("B");
+        b.setToggleGroup(alignGroup);
+        b.setOnAction(actionEvent -> deck.setAlignment(Pos.BASELINE_CENTER));
+        ToggleButton be = new ToggleButton("BE");
+        be.setToggleGroup(alignGroup);
+        be.setOnAction(actionEvent -> deck.setAlignment(Pos.BASELINE_RIGHT));
+
+        ToggleButton sw = new ToggleButton("SW");
+        sw.setToggleGroup(alignGroup);
+        sw.setOnAction(actionEvent -> deck.setAlignment(Pos.BOTTOM_LEFT));
+        ToggleButton s = new ToggleButton("S");
+        s.setToggleGroup(alignGroup);
+        s.setOnAction(actionEvent -> deck.setAlignment(Pos.BOTTOM_CENTER));
+        ToggleButton se = new ToggleButton("SE");
+        sw.setToggleGroup(alignGroup);
+        se.setOnAction(actionEvent -> deck.setAlignment(Pos.BOTTOM_RIGHT));
+
+        ToggleButton fill = new ToggleButton("Fill");
+        fill.setToggleGroup(alignGroup);
+        fill.setOnAction(actionEvent -> deck.setAlignment(null));
+
+        VBox vbox = new VBox(
+                deck,
+                new HBox(left, right),
+                cssCombo,
+                new HBox(nw, n, ne),
+                new HBox(w, c, e),
+                new HBox(bw, b, be),
+                new HBox(sw, s, se));
+
+        vbox.setPrefWidth(350);
+        vbox.setPrefHeight(350);
+
+        stage.setScene(new Scene(vbox));
+
 
         stage.setWidth(350);
         stage.setHeight(350);
 
+        cssCombo.getSelectionModel().selectFirst();
+
         stage.show();
     }
 

src/test/java/com/github/shemnon/deckcontrol/PileAngleDemo.java

 import com.github.shemnon.deckcontrol.skin.PileDeckSkin;
 import javafx.application.Application;
 import javafx.scene.Node;
-import javafx.scene.SceneBuilder;
-import javafx.scene.control.ButtonBuilder;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
 import javafx.scene.control.Label;
 import javafx.scene.control.Slider;
-import javafx.scene.control.SliderBuilder;
-import javafx.scene.layout.HBoxBuilder;
+import javafx.scene.layout.HBox;
 import javafx.scene.layout.Pane;
 import javafx.scene.layout.StackPane;
-import javafx.scene.layout.VBoxBuilder;
+import javafx.scene.layout.VBox;
 import javafx.scene.text.Text;
 import javafx.stage.Stage;
 
     public void start(final Stage stage) throws Exception {
         final Deck deck = createDeck();
 
-        Slider deckSlider;
-        Slider angleSlider;
-        stage.setScene(SceneBuilder.create()
-                .stylesheets("BigPile.css")
-                .root(
-                        VBoxBuilder.create()
-                                .fillWidth(false)
-                                .children(
-                                        deck,
-                                        HBoxBuilder.create().children(
-                                                ButtonBuilder.create()
-                                                        .text("<<")
-                                                        .onAction(actionEvent -> deck.previousNode()).build(),
-                                                ButtonBuilder.create()
-                                                        .text(">>")
-                                                        .onAction(actionEvent -> deck.nextNode()).build()
-                                        ).build(),
-                                        HBoxBuilder.create().children(
-                                                new Label("Deck Position:"),
-                                                deckSlider = SliderBuilder.create()
-                                                        .min(0)
-                                                        .max(14)
-                                                        .value(1)
-                                                        .build()
-                                        ).build(),
-                                        HBoxBuilder.create().children(
-                                                new Label("Spread Angle:"),
-                                                angleSlider = SliderBuilder.create()
-                                                        .min(0)
-                                                        .max(90)
-                                                        .value(45)
-                                                        .build()
-                                        ).build()
-                                ).build())
-                .width(300)
-                .height(300)
-                .build());
+        Button left = new Button("<<");
+        left.setOnAction(actionEvent -> deck.previousNode());
+        Button right = new Button(">>");
+        right.setOnAction(actionEvent -> deck.nextNode());
 
-        angleSlider.valueProperty().addListener((observableValue, oldValue, newValue) -> ((PileDeckSkin) deck.getSkin()).setSpreadAngle(newValue.doubleValue()));
+        Slider deckSlider = new Slider(0, 14, 1);
         deckSlider.valueProperty().bindBidirectional(deck.primaryNodeIndexProperty());
 
+        Slider angleSlider = new Slider(0, 90, 45);
+        angleSlider.valueProperty().addListener((observableValue, oldValue, newValue) -> ((PileDeckSkin) deck.getSkin()).setSpreadAngle(newValue.doubleValue()));
+
+
+        VBox vbox = new VBox(
+                deck,
+                new HBox(left, right),
+                new HBox(
+                        new Label("Deck Position:"),
+                        deckSlider
+                ),
+                new HBox(
+                        new Label("Spread Angle:"),
+                        angleSlider
+                )
+        );
+        vbox.setFillWidth(false);
+        vbox.setPrefWidth(300);
+        vbox.setPrefHeight(300);
+
+        Scene scene = new Scene(vbox);
+        scene.getStylesheets().setAll("BigPile.css");
+
+        stage.setScene(scene);
         stage.setWidth(300);
         stage.setHeight(300);