- java.lang.Object
-
- org.praxislive.code.userapi.Property.Animator
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Property.Animator
ease()
Convenience method to useEasing.ease
easing for all keyframes.Property.Animator
easeIn()
Convenience method to useEasing.easeIn
easing for all keyframes.Property.Animator
easeInOut()
Convenience method to useEasing.easeInOut
easing for all keyframes.Property.Animator
easeOut()
Convenience method to useEasing.easeOut
easing for all keyframes.Property.Animator
easing(Easing... easing)
Set the easing mode for each keyframe.Property.Animator
in(double... in)
Set the time in seconds for each keyframe.boolean
isAnimating()
Whether an animation is currently active.Property.Animator
linear()
Convenience method to useEasing.linear
easing for all keyframes.Property.Animator
stop()
Stop animating.Property.Animator
to(double... to)
Set the target values for animation and start animation.Property.Animator
whenDone(Consumer<Property> whenDoneConsumer)
Set a consumer to be called each time the Animator finishes animation.
-
-
-
Method Detail
-
to
public Property.Animator to(double... to)
Set the target values for animation and start animation. The number of values provided to this method controls the number of keyframes.- Parameters:
to
- target values- Returns:
- this
-
in
public Property.Animator in(double... in)
Set the time in seconds for each keyframe. The number of provided values may be different than the number of keyframes passed to to(). Values will be cycled through as needed.eg.
to(100, 50, 250).in(1, 0.5)
is the same asto(100, 50, 250).in(1, 0.5, 1)
- Parameters:
in
- times in seconds- Returns:
- this
-
easing
public Property.Animator easing(Easing... easing)
Set the easing mode for each keyframe. The number of provided values may be different than the number of keyframes passed to to(). Values will be cycled through as needed.- Parameters:
easing
- easing mode to use- Returns:
- this
-
linear
public Property.Animator linear()
Convenience method to useEasing.linear
easing for all keyframes.- Returns:
- this
-
ease
public Property.Animator ease()
Convenience method to useEasing.ease
easing for all keyframes.- Returns:
- this
-
easeIn
public Property.Animator easeIn()
Convenience method to useEasing.easeIn
easing for all keyframes.- Returns:
- this
-
easeOut
public Property.Animator easeOut()
Convenience method to useEasing.easeOut
easing for all keyframes.- Returns:
- this
-
easeInOut
public Property.Animator easeInOut()
Convenience method to useEasing.easeInOut
easing for all keyframes.- Returns:
- this
-
stop
public Property.Animator stop()
Stop animating. The current property value will be retained.- Returns:
- this
-
isAnimating
public boolean isAnimating()
Whether an animation is currently active.- Returns:
- animation active
-
whenDone
public Property.Animator whenDone(Consumer<Property> whenDoneConsumer)
Set a consumer to be called each time the Animator finishes animation. Also calls the consumer immediately if no animation is currently active.Unlike restarting an animation by polling isAnimating(), an animation started inside this consumer will take into account any time overrun between the target and actual finish time of the completing animation.
- Parameters:
whenDoneConsumer
- function to call- Returns:
- this
-
-