Using Transitions to Simplify JavaFX Animations
- Using Transitions to Simplify JavaFX Animations
- The Transition Superclass
- Basic Transitions
- Basic Transitions, Continued
- Compound Transitions
- Creating Additional Transitions
- Conclusion
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.
(Article continues after the video.)
You need to upgrade your Flash Player. You need version 9 or above to view this video. You may download it here. You may also see this message if you have JavaScript turned off. If this is the case, please enable JavaScript and reload the page.