/ General / BindableTransition

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.

2 POST COMMENT

Send Us A Message Here

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

2 Comments