viewtify.ui.anime
Anime
The Anime class provides a fluent API for defining and running animations in JavaFX.
Animations can be applied to various properties of UI elements, such as opacity, background
color, and location.
Usage example:
Anime.define()
.duration(0.5) // Set default animation duration
.interpolator(Interpolator.EASE_OUT) // Set default interpolation
.opacity(nodeProvider, 0.0) // Animate opacity of a node
.backgroundColor(regionProvider, Color.RED) // Animate background color of a region
.moveX(nodeProvider, 100) // Animate horizontal movement of a node
.then(() -> System.out.println("Animation completed"))
.run();
The class supports chaining of animation effects and provides shorthands for common animation scenarios.
Key concepts:
WritableValue: Represents a writable property that can be animated.Interpolator: Defines the rate of change of an animation over time.Duration: Represents the length of an animation.
Animations are defined using a fluent API, and effects are applied to properties using the
effect method. The run method is then called to execute the animation.
Animations can also be configured to run infinitely with the runInfinitely method.
The class also provides a set of predefined effects for common animation scenarios, such as changing opacity, background color, and location of UI elements.
Additionally, post-action effects can be registered using the effect method, and
subsequent actions can be defined using the then method.
The Anime class is designed to be used in conjunction with JavaFX UI elements and
supports smooth and flexible animation creation and execution.
BASE_DURATIONjavafx.util.Duration
The standard effect time.
define()Anime
Anime |
Create new Anime.
interpolator(javafx.animation.Interpolatorinterpolator)Anime
javafx.animation.Interpolatorinterpolator)javafx.animation.Interpolatorinterpolator |
|
Anime |
Chainable API. |
Set default interpolation.
duration(doubleduration)Anime
doubleduration)doubleduration |
|
Anime |
Chainable API. |
Set default duration.
duration(javafx.util.Durationduration)Anime
javafx.util.Durationduration)javafx.util.Durationduration |
|
Anime |
Chainable API. |
Set default duration.
delay(doubledelay)Anime
doubledelay)doubledelay |
|
Anime |
Chainable API. |
Set default delay.
delay(javafx.util.Durationdelay)Anime
javafx.util.Durationdelay)javafx.util.Durationdelay |
|
Anime |
Chainable API. |
Set default delay.
init(javafx.beans.value.WritableValueNumbervalue, Numbernum)Anime
javafx.beans.value.WritableValueNumbervalue, Numbernum)javafx.beans.value.WritableValuevalue |
|
Numbernum |
|
Anime |
Shorthand to declare animation effect.
init(kiss.WiseRunnableinit)Anime
kiss.WiseRunnableinit)kiss.WiseRunnableinit |
|
Anime |
Shorthand to declare animation effect.
backgroundColor(UserInterfaceProvider?javafx.scene.layout.Regionregion, javafx.scene.paint.Colorcolor)Anime
UserInterfaceProvider?javafx.scene.layout.Regionregion, javafx.scene.paint.Colorcolor)UserInterfaceProviderregion |
|
javafx.scene.paint.Colorcolor |
|
Anime |
Animate background color
opacity(UserInterfaceProvider?Nodenode, doublenum)Anime
UserInterfaceProvider?Nodenode, doublenum)UserInterfaceProvidernode |
|
doublenum |
|
Anime |
Animate background color
opacity(Nodenode, doublenum)Anime
Nodenode, doublenum)Nodenode |
|
doublenum |
|
Anime |
Animate background color
move(UserInterfaceProvider?Nodenode, doublex, doubley)Anime
UserInterfaceProvider?Nodenode, doublex, doubley)UserInterfaceProvidernode |
|
doublex |
|
doubley |
|
Anime |
Animate location.
moveX(Nodenode, doublex)Anime
Nodenode, doublex)Nodenode |
|
doublex |
|
Anime |
Animate location.
moveX(UserInterfaceProvider?Nodenode, doublex)Anime
UserInterfaceProvider?Nodenode, doublex)UserInterfaceProvidernode |
|
doublex |
|
Anime |
Animate location.
moveY(Nodenode, doubley)Anime
Nodenode, doubley)Nodenode |
|
doubley |
|
Anime |
Animate location.
moveY(UserInterfaceProvider?Nodenode, doubley)Anime
UserInterfaceProvider?Nodenode, doubley)UserInterfaceProvidernode |
|
doubley |
|
Anime |
Animate location.
effect(javafx.beans.value.WritableValueVvalue, Vnum)Anime
javafx.beans.value.WritableValueVvalue, Vnum)V |
|
javafx.beans.value.WritableValuevalue |
The |
Vnum |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableValueVvalue, UnaryOperatorVnum)Anime
javafx.beans.value.WritableValueVvalue, UnaryOperatorVnum)V |
|
javafx.beans.value.WritableValuevalue |
|
UnaryOperatornum |
|
Anime |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableIntegerValuevalue, IntUnaryOperatornum)Anime
javafx.beans.value.WritableIntegerValuevalue, IntUnaryOperatornum)javafx.beans.value.WritableIntegerValuevalue |
The |
IntUnaryOperatornum |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableLongValuevalue, LongUnaryOperatornum)Anime
javafx.beans.value.WritableLongValuevalue, LongUnaryOperatornum)javafx.beans.value.WritableLongValuevalue |
The |
LongUnaryOperatornum |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableDoubleValuevalue, DoubleUnaryOperatornum)Anime
javafx.beans.value.WritableDoubleValuevalue, DoubleUnaryOperatornum)javafx.beans.value.WritableDoubleValuevalue |
The |
DoubleUnaryOperatornum |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableValueVvalue, Vnum, javafx.animation.Interpolatorinterpolator)Anime
javafx.beans.value.WritableValueVvalue, Vnum, javafx.animation.Interpolatorinterpolator)V |
|
javafx.beans.value.WritableValuevalue |
The |
Vnum |
The target value for the animation. |
javafx.animation.Interpolatorinterpolator |
The |
Anime |
This |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableValueVvalue, Vnum, doublesec)Anime
javafx.beans.value.WritableValueVvalue, Vnum, doublesec)V |
|
javafx.beans.value.WritableValuevalue |
|
Vnum |
|
doublesec |
|
Anime |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableValueVvalue, Vnum, doublesec, javafx.animation.Interpolatorinterpolator)Anime
javafx.beans.value.WritableValueVvalue, Vnum, doublesec, javafx.animation.Interpolatorinterpolator)V |
|
javafx.beans.value.WritableValuevalue |
|
Vnum |
|
doublesec |
|
javafx.animation.Interpolatorinterpolator |
|
Anime |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableValueVvalue, Vnum, javafx.util.Durationduration)Anime
javafx.beans.value.WritableValueVvalue, Vnum, javafx.util.Durationduration)V |
|
javafx.beans.value.WritableValuevalue |
|
Vnum |
|
javafx.util.Durationduration |
|
Anime |
Shorthand to declare animation effect.
effect(javafx.beans.value.WritableValueVvalue, Vnum, javafx.util.Durationduration, javafx.animation.Interpolatorinterpolator)Anime
javafx.beans.value.WritableValueVvalue, Vnum, javafx.util.Durationduration, javafx.animation.Interpolatorinterpolator)V |
|
javafx.beans.value.WritableValuevalue |
|
Vnum |
|
javafx.util.Durationduration |
|
javafx.animation.Interpolatorinterpolator |
|
Anime |
Shorthand to declare animation effect.
effect(kiss.WiseRunnableeffect)Anime
kiss.WiseRunnableeffect)kiss.WiseRunnableeffect |
The post-action effect to be registered. |
Anime |
This |
Shorthand to declare animation effect.
then(kiss.WiseRunnablefinisher)Anime
kiss.WiseRunnablefinisher)kiss.WiseRunnablefinisher |
The actions to be performed after the current animation. |
Anime |
This |
Define the next action.
run(kiss.WiseRunnablefinisher)kiss.Disposable
kiss.WiseRunnablefinisher)kiss.WiseRunnablefinisher |
The actions to be performed after the animation completes. |
kiss.Disposable |
A |
Play animation.
runInfinitely()kiss.Disposable
kiss.Disposable |
A |
Play animation with loop.