/ General / BindableTransition


Hendrik on 2012/12/31 - 17:10 in General, JavaFX

JavaFX supports a lot of transition and animation classes for Node properties like the javafx.animation.ScaleTransition. But sometimes you need a special animation for that no default transition is provided by JavaFX. Currently the best pratice is to extend javafx.animation.Transitionand override theĀ interpolate(double frac) method:

Because JavaFX offers PropertyBinding I created a BindableTransition which current fraction is a Property and can be bind to any other NumberProperty. Here is an example:

The fractionProperty of the BindableTransition is bound to three different Properties and the result will look like this:

The BindableTransition class and a demo are commited to the JFXtras project.


Send Us A Message Here

Your email address will not be published. Required fields are marked *