Releases: iamgio/animated
1.3.0
- Added
AnimatedSlider
, aSlider
implementation that dynamically animates its value. - Added animation callbacks (#6)
Callbacks
Animation callbacks were added to:
AnimationProperty
- Presets
AnimatedValue
, includingAnimatedValueLabel
Animation
transition
The callback for Animation
(used for AnimateFX-based features, such as switchers and animated containers) is extremely simple:
Animation animation = new Animation(new FadeIn());
animation.setOnFinished(e -> ...);
For the sake of usability, a fluent setter was also added:
Animation animation = new Animation(new FadeIn()).onFinished(e -> ...);
binding
The implementation for the binding
package is slightly different: the classes listed previously now feature setOnAnimationStarted
and setOnAnimationEnded
.
AnimationProperty<Double> property = AnimationProperty.of(someProperty());
property.setOnAnimationStarted(e -> ...);
property.setOnAnimationEnded(e -> ...);
They handle AnimationEvent
s that can be affected by interruptions.
From the AnimationEvent#isInterrupted()
documentation:
- If this event represents the end of an animation, the interrupted status means the animation stopped before the expected time because the wrapped value was externally changed and a new animation has to be played.
- If this event represents the start of an animation, the interrupted status means the animation started right after an interrupted end animation.
property.setOnAnimationEnded(e -> {
if (e.isInterrupted()) {
System.out.println("The animation was interrupted, a new one will play now");
}
})
A fluent setter is available here too:
Animated animated = new Animated(node,
new AnimatedOpacity()
.onAnimationEnded(e -> ...)
)
AnimationProperty.of(someProperty()).onAnimationStarted(e -> ...).register();
AnimatedValueLabel<Double> label = new AnimatedValueLabel<>(0.0)
.onAnimationStarted(e -> ...)
.onAnimationEnded(e -> ...);
1.2.0
Changelog
- Added clip animations that create negative space around a node:
CircleClipIn
,CircleClipOut
,RectangleClipIn
,RectangleClipOut
. They can be used the same way other AnimateFX animations are used; - Fixed a visual bug that would produce blurry images with an
AnimatedThemeSwitcher
on high-DPI screens; Animation
can no longer wrap null animations.Animation.none()
now returns an instance ofNone
;Animation
'sdelay
property can now be set via FXML;AnimatedSwitcher#of
now throws anIllegalStateException
instead ofIllegalAccessError
if a child is already set;Curve
was moved to thecommon
package.
CircleClipOut
used with anAnimatedThemeSwitcher
1.1.0
Changelog
- Added
AnimatedValueLabel
to display some content which is implicitly animated every time its value changes: see the README for further information (example code); - Added
AnimationProperty#addBinding
to bind a property to an animated one; - Added
IntegerPropertyWrapper
to allow animated bindings forint
values; - Added elastic animation curves:
EASE_IN_ELASTIC
,EASE_OUT_ELASTIC
,EASE_IN_OUT_ELASTIC
; AnimatedThemeSwitcher#init
now throws anIllegalStateException
if it had already been initialized (related to #4);- Removed the generic type from the
CustomizableAnimation#custom
method signature; - Moved the
Pausable
interface to the newcommon
package.
1.0.1
1.0.0
animated is getting a new major release!
Common changelog
- The package layout has been changed for the sake of clarity.
The library is now split in two independent parts:binding
(implicit animations that react to changes), andtransition
(features that rely on AnimateFX animations). - Added full FXML support: see the README for more information.
binding
changelog
The implicit binding API has been redesigned to provide a more concise way to create implicit animations:
-
Animated
now accepts multiple properties at once that can also be edited later viagetTargetProperties()
.AnimatedMulti
was removed. -
Animated
is no longer generic. -
Pre-made animated nodes (such as
AnimatedOpacity
) are now properties called presets.
This lets you mix standard properties and presets within the sameAnimated
node with ease.
Presets also have a new zero-arguments constructor that lets the property inherit the target node from itsAnimated
parent.Animated animated = new Animated(child, new AnimatedOpacity());
-
Animated
now requires animation properties instead of property wrappers.
You can useAnimationProperty.of
to wrap a JavaFX property instead ofPropertyWrapper.of
.Animated animated = new Animated(child, AnimationProperty.of(child.opacityProperty()));
-
AnimatedSize
was renamed toAnimatedPrefSize
. -
AnimatedPosition
was renamed toAnimatedTranslatePosition
. -
AnimatedDropShadow
was split into two different properties:AnimatedDropShadow.Color
andAnimatedDropShadow.Radius
. -
Removed
isActive()
andsetActive(active)
fromAnimated
andAnimationProperty
. They now implement thePausable
interface, withisPaused()
,pause()
,resume()
. -
Removed the deprecated
PropertyWrapper#createParallelProperty
method.
transition
changelog
-
AnimateFX-based features now have empty constructors that use
FadeIn
andFadeOut
as default entrance and exit animations, which can now be updated after instantiation viasetIn
andsetOut
.animationInProperty()
andanimationOutProperty()
were also added. These classes include:AnimatedContainer
subclasses:AnimatedHBox
andAnimatedVBox
;AnimatedSwitcher
;AnimatedLabel
.
-
AnimatedThemeSwitcher
is now instantiated via a constructor, and the staticinit
method was removed.
A non-staticinit()
method must be called after instantiation in order to register the hook.AnimatedThemeSwitcher themeSwitcher = new AnimatedThemeSwitcher(scene, new FadeOut()); themeSwitcher.init();
-
AnimatedThemeSwitcher
's previousgetAnimation
was replaced withgetOut
.setOut
is also available. -
Fixed
AnimatedLabel
not pausing correctly. -
Added
AnimatedSwitcher#childProperty
. -
Added
AnimatedLabel#currentLabelProperty
andAnimatedLabel#labelFactoryProperty
.
Migration guide
If you are upgrading the library from a 0.x.x version, you will most likely have a bunch of errors to fix before having a successful compilation. Here are some useful fixes:
-
The package layout has been changed: let your IDE find out the new location of the imported classes.
-
Use
AnimationProperty.of
instead ofPropertyWrapper.of
. Also,Animated
is no longer generic, so you can remove the diamonds. -
Use
AnimationProperty#register
instead ofPropertyWrapper#registerAnimation
for independent animations. -
Use presets instead of pre-made animated nodes:
// Before AnimatedOpacity animated = new AnimatedOpacity(node); // After Animated animated = new Animated(node, new AnimatedOpacity());
-
Use
Animated
instead ofAnimatedMulti
:// Before AnimatedMulti animated = new AnimatedMulti(node, PropertyWrapper.of(node.prefWidthProperty()), PropertyWrapper.of(node.prefHeightProperty() ); // After Animated animated = new Animated(node, AnimationProperty.of(node.prefWidthProperty()), AnimationProperty.of(node.prefHeightProperty()) ); // Or even better Animated animated = new Animated(node, new AnimatedPrefSize());
-
Instantiate
AnimatedThemeSwitcher
via constructor instead of the staticinit
method:// Before AnimatedThemeSwitcher themeSwitcher = AnimatedThemeSwitcher.init(scene); // After AnimatedThemeSwitcher themeSwitcher = new AnimatedThemeSwitcher(scene, new FadeOut()); themeSwitcher.init();
-
Use
AnimatedThemeSwitcher#get/setOut
instead ofget/setAnimation
.
0.7.0
- Animated containers are more optimized;
- Stricter rules have been applied to constructors (
AnimatedSwitcher
,AnimatedContainer
,AnimatedThemeSwitcher
, ...) regardingnull
animations, that aren't accepted now; - Added the
Animation.none()
method (equivalent tonew Animation(null)
to represent a non-animation; - Implemented
PropertyWrapper#registerAnimation
as a preferred alternative tonew AnimationProperty(propertyWrapper).register()
.
0.6.1
AnimationProperty
was moved out of theinternal
package as a valid, flexible alternative toAnimated
;PropertyWrapper.of
and the Kotlin extension functionProperty#animated
now feature different overloads for each supported wrapper type in order to minimize ambiguity;- Added
Automatic-Module-Name
(#2); - Fixed some missing Javadocs due to syntax errors.
0.6.0
AnimatedThemeSwitcher
is now completely implicit: it now directly affects the scene's stylesheets and does not need to be carried around;- Implemented
AnimatedLabel
to animate text changes; - Fixed a relocation issue with
AnimatedHBox
; - Added 9 more curves (expo, back and bounce for ease in/out/in-out) and add
Curve#getCurveFunction
; - Some classes that are intended to be used internally have been moved to the
internal
sub-package.