Search in sources :

Example 1 with Animation

use of javafx.animation.Animation in project JFoenix by jfoenixadmin.

the class JFXAlert method hideWithAnimation.

/**
 * play the hide animation for the dialog, as the java hide method is set to final
 * so it can not be overridden
 */
public void hideWithAnimation() {
    if (transition == null || transition.getStatus().equals(Animation.Status.STOPPED)) {
        JFXAlertAnimation currentAnimation = getCurrentAnimation();
        Animation animation = currentAnimation.createHidingAnimation(getDialogPane().getContent(), getDialogPane());
        if (animation != null) {
            transition = animation;
            animation.setOnFinished(finish -> {
                animateClosing = false;
                hide();
                transition = null;
            });
            animation.play();
        } else {
            animateClosing = false;
            transition = null;
            Platform.runLater(this::hide);
        }
    }
}
Also used : JFXAlertAnimation(com.jfoenix.animation.alert.JFXAlertAnimation) JFXAlertAnimation(com.jfoenix.animation.alert.JFXAlertAnimation) Animation(javafx.animation.Animation)

Example 2 with Animation

use of javafx.animation.Animation in project FXyzLib by Birdasaur.

the class CameraController method setCamera.

public void setCamera(AdvancedCamera camera) {
    this.camera = camera;
    switch(animPref) {
        case TIMELINE:
            timeline.getKeyFrames().addAll(new KeyFrame(Duration.millis(15), e -> {
                new Timeline(new KeyFrame[] { new KeyFrame(Duration.ONE, ev -> {
                    update();
                }) }).play();
            }));
            timeline.play();
            break;
        case TIMER:
            timer.start();
            break;
        case TRANSITION:
            transition.play();
            break;
        case ANIMATION:
            break;
    }
}
Also used : Scene(javafx.scene.Scene) KeyFrame(javafx.animation.KeyFrame) MouseEvent(javafx.scene.input.MouseEvent) AnimationPreference(org.fxyz.utils.AnimationPreference) Timeline(javafx.animation.Timeline) KeyEvent(javafx.scene.input.KeyEvent) ScrollEvent(javafx.scene.input.ScrollEvent) Transition(javafx.animation.Transition) AdvancedCamera(org.fxyz.cameras.AdvancedCamera) MIDDLE(javafx.scene.input.MouseButton.MIDDLE) SECONDARY(javafx.scene.input.MouseButton.SECONDARY) Transformable(org.fxyz.extras.Transformable) AnimationTimer(javafx.animation.AnimationTimer) Duration(javafx.util.Duration) Point2D(javafx.geometry.Point2D) Animation(javafx.animation.Animation) SubScene(javafx.scene.SubScene) PRIMARY(javafx.scene.input.MouseButton.PRIMARY) Timeline(javafx.animation.Timeline) KeyFrame(javafx.animation.KeyFrame)

Example 3 with Animation

use of javafx.animation.Animation in project JFoenix by jfoenixadmin.

the class JFXNodesAnimation method animate.

public void animate() {
    init();
    Animation exitAnimation = animateExit();
    Animation sharedAnimation = animateSharedNodes();
    Animation entranceAnimation = animateEntrance();
    exitAnimation.setOnFinished(finish -> sharedAnimation.play());
    sharedAnimation.setOnFinished(finish -> entranceAnimation.play());
    entranceAnimation.setOnFinished(finish -> end());
    exitAnimation.play();
}
Also used : Animation(javafx.animation.Animation)

Aggregations

Animation (javafx.animation.Animation)3 JFXAlertAnimation (com.jfoenix.animation.alert.JFXAlertAnimation)1 AnimationTimer (javafx.animation.AnimationTimer)1 KeyFrame (javafx.animation.KeyFrame)1 Timeline (javafx.animation.Timeline)1 Transition (javafx.animation.Transition)1 Point2D (javafx.geometry.Point2D)1 Scene (javafx.scene.Scene)1 SubScene (javafx.scene.SubScene)1 KeyEvent (javafx.scene.input.KeyEvent)1 MIDDLE (javafx.scene.input.MouseButton.MIDDLE)1 PRIMARY (javafx.scene.input.MouseButton.PRIMARY)1 SECONDARY (javafx.scene.input.MouseButton.SECONDARY)1 MouseEvent (javafx.scene.input.MouseEvent)1 ScrollEvent (javafx.scene.input.ScrollEvent)1 Duration (javafx.util.Duration)1 AdvancedCamera (org.fxyz.cameras.AdvancedCamera)1 Transformable (org.fxyz.extras.Transformable)1 AnimationPreference (org.fxyz.utils.AnimationPreference)1