java.lang.Object
io.github.palexdev.materialfx.utils.AnimationUtils.AbstractBuilder
- Direct Known Subclasses:
AnimationUtils.ParallelBuilder,AnimationUtils.SequentialBuilder
- Enclosing class:
- AnimationUtils
Common base class for
AnimationUtils.ParallelBuilder and AnimationUtils.SequentialBuilder.
This builder, designed with fluent api, allows you to create simple and complex animations with just a few lines of code.
The builder keeps the reference of the "main" animation (depending on the subclass can be ParallelTransition or SequentialTransition, in
the AbstractBuilder the type is a generic Animation), and defines and abstract method that subclasses must implement
to properly add animations to the "main".-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the animation from the supplier and adds it to the "main" animation by callingaddAnimation(Animation).add(Supplier<Animation> animationSupplier, EventHandler<ActionEvent> onFinished) Gets the animation from the supplier, sets the given onFinished action to it and then adds it to the "main" animation by callingaddAnimation(Animation).Adds the given animation to the "main" animation by callingaddAnimation(Animation).add(Animation animation, EventHandler<ActionEvent> onFinished) Sets the given onFinished action to the given animation and then adds it to the "main" animation by callingaddAnimation(Animation).Builds aTimelinewith the given keyframes and adds it to the "main" animation by callingaddAnimation(Animation).add(EventHandler<ActionEvent> onFinished, KeyFrame... keyFrames) Builds aTimelinewith the given keyframes, sets the given onFinished action to it and then adds it to the "main" animation by callingaddAnimation(Animation).protected abstract voidaddAnimation(Animation animation) Adds the given animation to the "main" animation.For each given node builds and adds an animation that disables the node after the given duration of time.For each given node builds and adds an animation that enables the node after the given duration of time.abstract AnimationCallshide(Duration, Node...)by converting the given millis value withDuration.millis(double).Callshide(Duration, Window...)by converting the given millis value withDuration.millis(double).hide(AnimationsData... data) Creates and adds a fade out animation for each givenAnimationsData.For each given node builds and adds an animation that hides the node by fading it out.For each given window builds and adds an animation that hides the window by fading it out.protected voidsetCycleCount(int cycleCount) Sets the "main" animation cycle count.setDelay(double millis) Sets the "main" animation delay.Sets the "main" animation delay.setOnFinished(EventHandler<ActionEvent> onFinished) Sets the action to perform when the "main" animation ends.setRate(double rate) Sets the "main" animation rate/speed.Callsshow(Duration, Node...)by converting the given millis value withDuration.millis(double).Callsshow(Duration, Window...)by converting the given millis value withDuration.millis(double).show(AnimationsData... data) Creates and adds a fade in animation for each givenAnimationsData.For each given node builds and adds an animation that shows the node by fading it in.For each given window builds and adds an animation that shows the window by fading it in.
-
Field Details
-
animation
-
-
Constructor Details
-
AbstractBuilder
public AbstractBuilder()
-
-
Method Details
-
addAnimation
Adds the given animation to the "main" animation. -
getAnimation
- Returns:
- the "main" animation instance
-
init
-
add
Adds the given animation to the "main" animation by callingaddAnimation(Animation). -
add
public AnimationUtils.AbstractBuilder add(Animation animation, EventHandler<ActionEvent> onFinished) Sets the given onFinished action to the given animation and then adds it to the "main" animation by callingaddAnimation(Animation). -
add
Gets the animation from the supplier and adds it to the "main" animation by callingaddAnimation(Animation). -
add
public AnimationUtils.AbstractBuilder add(Supplier<Animation> animationSupplier, EventHandler<ActionEvent> onFinished) Gets the animation from the supplier, sets the given onFinished action to it and then adds it to the "main" animation by callingaddAnimation(Animation). -
add
Builds aTimelinewith the given keyframes and adds it to the "main" animation by callingaddAnimation(Animation). -
add
public AnimationUtils.AbstractBuilder add(EventHandler<ActionEvent> onFinished, KeyFrame... keyFrames) Builds aTimelinewith the given keyframes, sets the given onFinished action to it and then adds it to the "main" animation by callingaddAnimation(Animation). -
disable
For each given node builds and adds an animation that disables the node after the given duration of time.- Parameters:
duration- the time after which the nodes are disabled
-
enable
For each given node builds and adds an animation that enables the node after the given duration of time.- Parameters:
duration- the duration after which the nodes are enabled
-
hide
For each given window builds and adds an animation that hides the window by fading it out.- Parameters:
duration- the fade animation speed
-
hide
Callshide(Duration, Window...)by converting the given millis value withDuration.millis(double). -
hide
For each given node builds and adds an animation that hides the node by fading it out.- Parameters:
duration- the fade animation speed
-
hide
Callshide(Duration, Node...)by converting the given millis value withDuration.millis(double). -
hide
Creates and adds a fade out animation for each givenAnimationsData. -
show
For each given window builds and adds an animation that shows the window by fading it in.- Parameters:
duration- the fade animation speed
-
show
Callsshow(Duration, Window...)by converting the given millis value withDuration.millis(double). -
show
For each given node builds and adds an animation that shows the node by fading it in.- Parameters:
duration- the fade animation speed
-
show
Callsshow(Duration, Node...)by converting the given millis value withDuration.millis(double). -
show
Creates and adds a fade in animation for each givenAnimationsData. -
setOnFinished
Sets the action to perform when the "main" animation ends. -
setCycleCount
Sets the "main" animation cycle count. -
setDelay
Sets the "main" animation delay. -
setDelay
Sets the "main" animation delay. -
setRate
Sets the "main" animation rate/speed.
-