use of javafx.scene.PerspectiveCamera in project Board-Instrumentation-Framework by intel.
the class FlipClock method start.
@Override
public void start(Stage stage) {
// Create the red flaps for the seconds
SplitFlapImgFactory.INSTANCE.setFlapColor(Color.web("#FF1200"));
secLeft.setBackgroundImage(SplitFlapImgFactory.INSTANCE.createBackgroundImage(234, 402));
secLeft.setFlapImage(SplitFlapImgFactory.INSTANCE.createFlapImage(234, 402));
secRight.setBackgroundImage(SplitFlapImgFactory.INSTANCE.createBackgroundImage(234, 402));
secRight.setFlapImage(SplitFlapImgFactory.INSTANCE.createFlapImage(234, 402));
HBox dayBox = new HBox();
dayBox.setSpacing(0);
dayBox.getChildren().addAll(dayLeft, dayMid, dayRight);
dayBox.setLayoutX(12);
dayBox.setLayoutY(76);
HBox dateBox = new HBox();
dateBox.setSpacing(0);
dateBox.getChildren().addAll(dateLeft, dateRight);
dateBox.setLayoutX(495);
dateBox.setLayoutY(76);
HBox monthBox = new HBox();
monthBox.setSpacing(0);
monthBox.getChildren().addAll(monthLeft, monthMid, monthRight);
monthBox.setLayoutX(833);
monthBox.setLayoutY(76);
HBox clockBox = new HBox();
clockBox.setSpacing(0);
HBox.setMargin(hourRight, new Insets(0, 40, 0, 0));
HBox.setMargin(minRight, new Insets(0, 40, 0, 0));
clockBox.getChildren().addAll(hourLeft, hourRight, minLeft, minRight, secLeft, secRight);
clockBox.setLayoutY(375);
Pane pane = new Pane(dayBox, dateBox, monthBox, clockBox);
pane.setPadding(new Insets(10, 10, 10, 10));
Scene scene = new Scene(pane, 1280, 800, new LinearGradient(0, 0, 0, 800, false, CycleMethod.NO_CYCLE, new Stop(0.0, Color.rgb(28, 27, 22)), new Stop(0.25, Color.rgb(38, 37, 32)), new Stop(1.0, Color.rgb(28, 27, 22))));
scene.setCamera(new PerspectiveCamera());
stage.setScene(scene);
stage.show();
timer.start();
}
Aggregations