Search in sources :

Example 16 with Timeline

use of javafx.animation.Timeline in project fxexperience2 by EricCanull.

the class BounceOutDownTransition method starting.

@Override
protected void starting() {
    double endY = node.getScene().getHeight() - node.localToScene(0, 0).getY();
    timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.translateYProperty(), 0, WEB_EASE)), new KeyFrame(Duration.millis(200), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateYProperty(), -20, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateYProperty(), endY, WEB_EASE)));
    super.starting();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Example 17 with Timeline

use of javafx.animation.Timeline in project fxexperience2 by EricCanull.

the class FadeInLeftBigTransition method starting.

@Override
protected void starting() {
    double startX = -node.localToScene(0, 0).getX() - node.getBoundsInParent().getWidth();
    timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateXProperty(), startX, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateXProperty(), 0, WEB_EASE)));
    super.starting();
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Example 18 with Timeline

use of javafx.animation.Timeline in project fxexperience2 by EricCanull.

the class RotateOutUpRightTransition method starting.

@Override
protected void starting() {
    super.starting();
    rotate = new Rotate(0, node.getBoundsInLocal().getWidth(), node.getBoundsInLocal().getHeight());
    timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(rotate.angleProperty(), 0, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(rotate.angleProperty(), 90, WEB_EASE)));
    node.getTransforms().add(rotate);
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) Rotate(javafx.scene.transform.Rotate) KeyFrame(javafx.animation.KeyFrame)

Example 19 with Timeline

use of javafx.animation.Timeline in project fxexperience2 by EricCanull.

the class HingeTransition method starting.

@Override
protected void starting() {
    super.starting();
    double endY = node.getScene().getHeight() - node.localToScene(0, 0).getY();
    rotate = new Rotate(0, 0, 0);
    timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(rotate.angleProperty(), 0, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(200), new KeyValue(rotate.angleProperty(), 80, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(400), new KeyValue(rotate.angleProperty(), 60, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(600), new KeyValue(rotate.angleProperty(), 80, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(800), new KeyValue(node.opacityProperty(), 1, Interpolator.EASE_BOTH), new KeyValue(node.translateYProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(rotate.angleProperty(), 60, Interpolator.EASE_BOTH)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 0, Interpolator.EASE_BOTH), new KeyValue(node.translateYProperty(), endY, Interpolator.EASE_BOTH), new KeyValue(rotate.angleProperty(), 60, Interpolator.EASE_BOTH)));
    node.getTransforms().add(rotate);
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) Rotate(javafx.scene.transform.Rotate) KeyFrame(javafx.animation.KeyFrame)

Example 20 with Timeline

use of javafx.animation.Timeline in project fxexperience2 by EricCanull.

the class RollInTransition method starting.

@Override
protected void starting() {
    super.starting();
    timeline = new Timeline(new KeyFrame(Duration.millis(0), new KeyValue(node.opacityProperty(), 0, WEB_EASE), new KeyValue(node.translateXProperty(), -node.getBoundsInLocal().getWidth(), WEB_EASE), new KeyValue(node.rotateProperty(), -120, WEB_EASE)), new KeyFrame(Duration.millis(1000), new KeyValue(node.opacityProperty(), 1, WEB_EASE), new KeyValue(node.translateXProperty(), 0, WEB_EASE), new KeyValue(node.rotateProperty(), 0, WEB_EASE)));
}
Also used : Timeline(javafx.animation.Timeline) KeyValue(javafx.animation.KeyValue) KeyFrame(javafx.animation.KeyFrame)

Aggregations

Timeline (javafx.animation.Timeline)91 KeyFrame (javafx.animation.KeyFrame)87 KeyValue (javafx.animation.KeyValue)77 Rotate (javafx.scene.transform.Rotate)14 MouseEvent (javafx.scene.input.MouseEvent)13 Duration (javafx.util.Duration)13 Interpolator (javafx.animation.Interpolator)12 Insets (javafx.geometry.Insets)9 PerspectiveCamera (javafx.scene.PerspectiveCamera)9 Scene (javafx.scene.Scene)8 ActionEvent (javafx.event.ActionEvent)7 Group (javafx.scene.Group)7 Node (javafx.scene.Node)7 KeyCode (javafx.scene.input.KeyCode)7 Color (javafx.scene.paint.Color)7 AnimationTimer (javafx.animation.AnimationTimer)6 EventHandler (javafx.event.EventHandler)6 Label (javafx.scene.control.Label)6 Rectangle (javafx.scene.shape.Rectangle)6 ArrayList (java.util.ArrayList)5