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_DURATION
javafx.util.Duration
The standard effect time.
define
()
Anime
Anime |
Create new Anime
.
interpolator
(javafx.animation.Interpolator
interpolator
)
Anime
javafx.animation.Interpolator
interpolator
)javafx.animation.Interpolator interpolator |
|
Anime |
Chainable API. |
Set default interpolation.
duration
(double
duration
)
Anime
double
duration
)double duration |
|
Anime |
Chainable API. |
Set default duration.
duration
(javafx.util.Duration
duration
)
Anime
javafx.util.Duration
duration
)javafx.util.Duration duration |
|
Anime |
Chainable API. |
Set default duration.
delay
(double
delay
)
Anime
double
delay
)double delay |
|
Anime |
Chainable API. |
Set default delay.
delay
(javafx.util.Duration
delay
)
Anime
javafx.util.Duration
delay
)javafx.util.Duration delay |
|
Anime |
Chainable API. |
Set default delay.
init
(javafx.beans.value.WritableValueNumber
value
, Number
num
)
Anime
javafx.beans.value.WritableValueNumber
value
, Number
num
)javafx.beans.value.WritableValue value |
|
Number num |
|
Anime |
Shorthand to declare animation effect.
init
(kiss.WiseRunnable
init
)
Anime
kiss.WiseRunnable
init
)kiss.WiseRunnable init |
|
Anime |
Shorthand to declare animation effect.
backgroundColor
(UserInterfaceProvider?
javafx.scene.layout.Region
region
, javafx.scene.paint.Color
color
)
Anime
UserInterfaceProvider?
javafx.scene.layout.Region
region
, javafx.scene.paint.Color
color
)UserInterfaceProvider region |
|
javafx.scene.paint.Color color |
|
Anime |
Animate background color
opacity
(UserInterfaceProvider?
Node
node
, double
num
)
Anime
UserInterfaceProvider?
Node
node
, double
num
)UserInterfaceProvider node |
|
double num |
|
Anime |
Animate background color
opacity
(Node
node
, double
num
)
Anime
Node
node
, double
num
)Node node |
|
double num |
|
Anime |
Animate background color
move
(UserInterfaceProvider?
Node
node
, double
x
, double
y
)
Anime
UserInterfaceProvider?
Node
node
, double
x
, double
y
)UserInterfaceProvider node |
|
double x |
|
double y |
|
Anime |
Animate location.
moveX
(Node
node
, double
x
)
Anime
Node
node
, double
x
)Node node |
|
double x |
|
Anime |
Animate location.
moveX
(UserInterfaceProvider?
Node
node
, double
x
)
Anime
UserInterfaceProvider?
Node
node
, double
x
)UserInterfaceProvider node |
|
double x |
|
Anime |
Animate location.
moveY
(Node
node
, double
y
)
Anime
Node
node
, double
y
)Node node |
|
double y |
|
Anime |
Animate location.
moveY
(UserInterfaceProvider?
Node
node
, double
y
)
Anime
UserInterfaceProvider?
Node
node
, double
y
)UserInterfaceProvider node |
|
double y |
|
Anime |
Animate location.
effect
(javafx.beans.value.WritableValueV
value
, V
num
)
Anime
javafx.beans.value.WritableValueV
value
, V
num
)V |
|
javafx.beans.value.WritableValue value |
The |
V num |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableValueV
value
, UnaryOperatorV
num
)
Anime
javafx.beans.value.WritableValueV
value
, UnaryOperatorV
num
)V |
|
javafx.beans.value.WritableValue value |
|
UnaryOperator num |
|
Anime |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableIntegerValue
value
, IntUnaryOperator
num
)
Anime
javafx.beans.value.WritableIntegerValue
value
, IntUnaryOperator
num
)javafx.beans.value.WritableIntegerValue value |
The |
IntUnaryOperator num |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableLongValue
value
, LongUnaryOperator
num
)
Anime
javafx.beans.value.WritableLongValue
value
, LongUnaryOperator
num
)javafx.beans.value.WritableLongValue value |
The |
LongUnaryOperator num |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableDoubleValue
value
, DoubleUnaryOperator
num
)
Anime
javafx.beans.value.WritableDoubleValue
value
, DoubleUnaryOperator
num
)javafx.beans.value.WritableDoubleValue value |
The |
DoubleUnaryOperator num |
The target value for the animation. |
Anime |
This |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableValueV
value
, V
num
, javafx.animation.Interpolator
interpolator
)
Anime
javafx.beans.value.WritableValueV
value
, V
num
, javafx.animation.Interpolator
interpolator
)V |
|
javafx.beans.value.WritableValue value |
The |
V num |
The target value for the animation. |
javafx.animation.Interpolator interpolator |
The |
Anime |
This |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableValueV
value
, V
num
, double
sec
)
Anime
javafx.beans.value.WritableValueV
value
, V
num
, double
sec
)V |
|
javafx.beans.value.WritableValue value |
|
V num |
|
double sec |
|
Anime |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableValueV
value
, V
num
, double
sec
, javafx.animation.Interpolator
interpolator
)
Anime
javafx.beans.value.WritableValueV
value
, V
num
, double
sec
, javafx.animation.Interpolator
interpolator
)V |
|
javafx.beans.value.WritableValue value |
|
V num |
|
double sec |
|
javafx.animation.Interpolator interpolator |
|
Anime |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableValueV
value
, V
num
, javafx.util.Duration
duration
)
Anime
javafx.beans.value.WritableValueV
value
, V
num
, javafx.util.Duration
duration
)V |
|
javafx.beans.value.WritableValue value |
|
V num |
|
javafx.util.Duration duration |
|
Anime |
Shorthand to declare animation effect.
effect
(javafx.beans.value.WritableValueV
value
, V
num
, javafx.util.Duration
duration
, javafx.animation.Interpolator
interpolator
)
Anime
javafx.beans.value.WritableValueV
value
, V
num
, javafx.util.Duration
duration
, javafx.animation.Interpolator
interpolator
)V |
|
javafx.beans.value.WritableValue value |
|
V num |
|
javafx.util.Duration duration |
|
javafx.animation.Interpolator interpolator |
|
Anime |
Shorthand to declare animation effect.
effect
(kiss.WiseRunnable
effect
)
Anime
kiss.WiseRunnable
effect
)kiss.WiseRunnable effect |
The post-action effect to be registered. |
Anime |
This |
Shorthand to declare animation effect.
then
(kiss.WiseRunnable
finisher
)
Anime
kiss.WiseRunnable
finisher
)kiss.WiseRunnable finisher |
The actions to be performed after the current animation. |
Anime |
This |
Define the next action.
run
(kiss.WiseRunnable
finisher
)
kiss.Disposable
kiss.WiseRunnable
finisher
)kiss.WiseRunnable finisher |
The actions to be performed after the animation completes. |
kiss.Disposable |
A |
Play animation.
runInfinitely
()
kiss.Disposable
kiss.Disposable |
A |
Play animation with loop.