Using Transitions to Simplify JavaFX Animations
JavaFX supports animation via a declarative model that's based upon timelines (time-based containers in which animations take place), keyframes (snapshots of animation state at points in time relative to their containing timelines), and interpolators (objects that calculate intermediate keyframes).
Although flexible, this keyframe animation model would normally require you to create the same (or nearly the same) animation boilerplate to perform fades, rotations, and other commonly occurring transitions. Fortunately, the JavaFX designers have addressed this situation by providing the javafx.animation.transition package of "canned" animated transition classes.
This article takes you on a tour of javafx.animation.transition. You first learn about this package's Transition superclass, which provides a common set of variables and functions that are inherited by all subclasses. Then we explore subclasses for performing basic and compound transitions. Finally, I'll briefly introduce Transition's support for creating additional transitions.