JavaFX Rotate Transition
This transition is used to apply the rotation transition on the node. It rotates the node along any of the three axes over the specified duration.
RotateTransition is represented by the class javafx.animation.RotateTransition. We just need to instantiate this class in order to generate an appropriate RotateTransition.
The properties of the class along with their setter methods are described in the following table.
||This is a object type property of the class Point3D. This represents the axis of rotate transition.
||This is a double type property. This represents the angle by which the object will be rotated.
||This is the object type property of the class Duration. This represents the duration of the rotate transition.
||It is a double type property. It represents the start Angle of the rotate transition.
||It is an object type property of the class Node. It represents the node on which the rotate transition to be applied.
||It is a double type property. It represents the stop angle value for the rotate transition.
There are three constructors in the class.
- public RotateTransition() : creates the new instance of RotateTransition with the default parameters.
- public RotateTransition(Duration duration) : Creates the new instance of RotateTransition with the specified duration value
- public RotateTransition(Duration duration, Node node): creates the new instance of RotateTransition with the specified duration value and Node on which, it is applied.
In the following example, we have made a rectangle rotating along the Z-axis by 360 degree.