functional/SceneGraphTests/src/test/scenegraph/app/TimelineApp.java

Print this page

        

*** 29,39 **** import javafx.event.ActionEvent; import javafx.event.Event; import javafx.event.EventHandler; import javafx.scene.Node; import javafx.scene.control.Button; - import javafx.scene.control.ButtonBuilder; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.scene.layout.TilePane; --- 29,38 ----
*** 141,170 **** final TilePane field = new TilePane(5, 5); field.setPrefColumns(2); final Timeline timeline = createTimelineAndPlayButton(field, "3"); timeline.setAutoReverse(false); timeline.setCycleCount(Timeline.INDEFINITE); ! field.getChildren().add(ButtonBuilder.create().text("stop").onAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { timeline.stop(); } ! }).build()); addSlot("infinite-stop", field); } //infinite + pause { final TilePane field = new TilePane(5, 5); field.setPrefColumns(2); final Timeline timeline = createTimelineAndPlayButton(field, "4"); timeline.setAutoReverse(false); timeline.setCycleCount(Timeline.INDEFINITE); ! field.getChildren().add(ButtonBuilder.create().text("pause").onAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { timeline.pause(); } ! }).build()); addSlot("infinite-pause", field); } return root; --- 140,173 ---- final TilePane field = new TilePane(5, 5); field.setPrefColumns(2); final Timeline timeline = createTimelineAndPlayButton(field, "3"); timeline.setAutoReverse(false); timeline.setCycleCount(Timeline.INDEFINITE); ! Button temp1 = new Button("stop"); ! temp1.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { timeline.stop(); } ! }); ! field.getChildren().add(temp1); addSlot("infinite-stop", field); } //infinite + pause { final TilePane field = new TilePane(5, 5); field.setPrefColumns(2); final Timeline timeline = createTimelineAndPlayButton(field, "4"); timeline.setAutoReverse(false); timeline.setCycleCount(Timeline.INDEFINITE); ! Button temp2 = new Button("pause"); ! temp2.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { timeline.pause(); } ! }); ! field.getChildren().add(temp2); addSlot("infinite-pause", field); } return root;