Search in sources :

Example 51 with PerspectiveCamera

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();
}
Also used : LinearGradient(javafx.scene.paint.LinearGradient) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Stop(javafx.scene.paint.Stop) PerspectiveCamera(javafx.scene.PerspectiveCamera) Scene(javafx.scene.Scene) Pane(javafx.scene.layout.Pane)

Aggregations

PerspectiveCamera (javafx.scene.PerspectiveCamera)51 Scene (javafx.scene.Scene)36 Group (javafx.scene.Group)31 KeyCode (javafx.scene.input.KeyCode)31 PointLight (javafx.scene.PointLight)28 Rotate (javafx.scene.transform.Rotate)25 MouseEvent (javafx.scene.input.MouseEvent)23 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)16 AnimationTimer (javafx.animation.AnimationTimer)14 KeyFrame (javafx.animation.KeyFrame)12 KeyValue (javafx.animation.KeyValue)12 Timeline (javafx.animation.Timeline)12 Point3D (org.fxyz.geometry.Point3D)11 AmbientLight (javafx.scene.AmbientLight)10 Translate (javafx.scene.transform.Translate)10 Color (javafx.scene.paint.Color)9 ArrayList (java.util.ArrayList)8 Interpolator (javafx.animation.Interpolator)7 OBJWriter (org.fxyz.utils.OBJWriter)7 PhongMaterial (javafx.scene.paint.PhongMaterial)6