public class AnimatedThemeSwitcher extends Object
AnimatedThemeSwitcher provides animated transitions that are played when changing the stylesheets of a Scene.| Modifier and Type | Method and Description |
|---|---|
void |
animateTheme(String stylesheet)
Changes the stylesheet of the scene and plays the exit animation.
|
javafx.beans.property.SimpleObjectProperty<Animation> |
animationProperty() |
Animation |
getAnimation() |
static AnimatedThemeSwitcher |
of(javafx.scene.Scene scene)
Gets an
AnimatedThemeSwitcher that wraps a Scene. |
void |
setAnimation(Animation animationOut) |
void |
setAnimation(animatefx.animation.AnimationFX animationOut) |
void |
setTheme(String stylesheet)
Changes the stylesheet of the scene without playing a transition.
|
public static AnimatedThemeSwitcher of(javafx.scene.Scene scene)
AnimatedThemeSwitcher that wraps a Scene.scene - JavaFX scene to affectAnimatedThemeSwitcher for the given SceneIllegalStateException - if the root of the scene is not suitable for the transition (e.g. VBox and HBox)public javafx.beans.property.SimpleObjectProperty<Animation> animationProperty()
public Animation getAnimation()
FadeOutpublic void setAnimation(Animation animationOut)
animationOut - exit animation to be played during the transition.IllegalArgumentException - if the animation is not an exit animation.public void setAnimation(animatefx.animation.AnimationFX animationOut)
animationOut - raw exit animation to be played during the transition.IllegalArgumentException - if the animation is not an exit animation.public void setTheme(String stylesheet)
stylesheet - path of the stylesheetpublic void animateTheme(String stylesheet)
stylesheet - path of the stylesheetCopyright © 2022. All rights reserved.