Releases: iamgio/animated
1.3.0
- Added
AnimatedSlider, aSliderimplementation that dynamically animates its value. - Added animation callbacks (#6)
Callbacks
Animation callbacks were added to:
AnimationProperty- Presets
AnimatedValue, includingAnimatedValueLabelAnimation
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 AnimationEvents 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
AnimatedThemeSwitcheron high-DPI screens; Animationcan no longer wrap null animations.Animation.none()now returns an instance ofNone;Animation'sdelayproperty can now be set via FXML;AnimatedSwitcher#ofnow throws anIllegalStateExceptioninstead ofIllegalAccessErrorif a child is already set;Curvewas moved to thecommonpackage.
CircleClipOutused with anAnimatedThemeSwitcher
1.1.0
Changelog
- Added
AnimatedValueLabelto display some content which is implicitly animated every time its value changes: see the README for further information (example code); - Added
AnimationProperty#addBindingto bind a property to an animated one; - Added
IntegerPropertyWrapperto allow animated bindings forintvalues; - Added elastic animation curves:
EASE_IN_ELASTIC,EASE_OUT_ELASTIC,EASE_IN_OUT_ELASTIC; AnimatedThemeSwitcher#initnow throws anIllegalStateExceptionif it had already been initialized (related to #4);- Removed the generic type from the
CustomizableAnimation#custommethod signature; - Moved the
Pausableinterface to the newcommonpackage.
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:
-
Animatednow accepts multiple properties at once that can also be edited later viagetTargetProperties().AnimatedMultiwas removed. -
Animatedis 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 sameAnimatednode with ease.
Presets also have a new zero-arguments constructor that lets the property inherit the target node from itsAnimatedparent.Animated animated = new Animated(child, new AnimatedOpacity());
-
Animatednow requires animation properties instead of property wrappers.
You can useAnimationProperty.ofto wrap a JavaFX property instead ofPropertyWrapper.of.Animated animated = new Animated(child, AnimationProperty.of(child.opacityProperty()));
-
AnimatedSizewas renamed toAnimatedPrefSize. -
AnimatedPositionwas renamed toAnimatedTranslatePosition. -
AnimatedDropShadowwas split into two different properties:AnimatedDropShadow.ColorandAnimatedDropShadow.Radius. -
Removed
isActive()andsetActive(active)fromAnimatedandAnimationProperty. They now implement thePausableinterface, withisPaused(),pause(),resume(). -
Removed the deprecated
PropertyWrapper#createParallelPropertymethod.
transition changelog
-
AnimateFX-based features now have empty constructors that use
FadeInandFadeOutas default entrance and exit animations, which can now be updated after instantiation viasetInandsetOut.animationInProperty()andanimationOutProperty()were also added. These classes include:AnimatedContainersubclasses:AnimatedHBoxandAnimatedVBox;AnimatedSwitcher;AnimatedLabel.
-
AnimatedThemeSwitcheris now instantiated via a constructor, and the staticinitmethod 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 previousgetAnimationwas replaced withgetOut.setOutis also available. -
Fixed
AnimatedLabelnot pausing correctly. -
Added
AnimatedSwitcher#childProperty. -
Added
AnimatedLabel#currentLabelPropertyandAnimatedLabel#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.ofinstead ofPropertyWrapper.of. Also,Animatedis no longer generic, so you can remove the diamonds. -
Use
AnimationProperty#registerinstead ofPropertyWrapper#registerAnimationfor 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
Animatedinstead 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
AnimatedThemeSwitchervia constructor instead of the staticinitmethod:// Before AnimatedThemeSwitcher themeSwitcher = AnimatedThemeSwitcher.init(scene); // After AnimatedThemeSwitcher themeSwitcher = new AnimatedThemeSwitcher(scene, new FadeOut()); themeSwitcher.init();
-
Use
AnimatedThemeSwitcher#get/setOutinstead ofget/setAnimation.
0.7.0
- Animated containers are more optimized;
- Stricter rules have been applied to constructors (
AnimatedSwitcher,AnimatedContainer,AnimatedThemeSwitcher, ...) regardingnullanimations, that aren't accepted now; - Added the
Animation.none()method (equivalent tonew Animation(null)to represent a non-animation; - Implemented
PropertyWrapper#registerAnimationas a preferred alternative tonew AnimationProperty(propertyWrapper).register().
0.6.1
AnimationPropertywas moved out of theinternalpackage as a valid, flexible alternative toAnimated;PropertyWrapper.ofand the Kotlin extension functionProperty#animatednow 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
AnimatedThemeSwitcheris now completely implicit: it now directly affects the scene's stylesheets and does not need to be carried around;- Implemented
AnimatedLabelto 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
internalsub-package.
