Search in sources :

Example 1 with JFXAlertAnimation

use of com.jfoenix.animation.alert.JFXAlertAnimation 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 JFXAlertAnimation

use of com.jfoenix.animation.alert.JFXAlertAnimation in project JFoenix by jfoenixadmin.

the class JFXAlert method getCurrentAnimation.

// this method ensure not null value for current animation
private JFXAlertAnimation getCurrentAnimation() {
    JFXAlertAnimation usedAnimation = getAnimation();
    usedAnimation = usedAnimation == null ? JFXAlertAnimation.NO_ANIMATION : usedAnimation;
    return usedAnimation;
}
Also used : JFXAlertAnimation(com.jfoenix.animation.alert.JFXAlertAnimation)

Aggregations

JFXAlertAnimation (com.jfoenix.animation.alert.JFXAlertAnimation)2 Animation (javafx.animation.Animation)1