Class RotateTransition

java.lang.Object
javafx.animation.Animation
javafx.animation.Transition
javafx.animation.RotateTransition

public final class RotateTransition extends Transition
This Transition creates a rotation animation that spans its duration. This is done by updating the rotate variable of the node at regular intervals. The angle value is specified in degrees.

It starts from the fromAngle if provided else uses the node's rotate value.

It stops at the toAngle value if provided else it will use start value plus byAngle.

The toAngle takes precedence if both toAngle and byAngle are specified.

Code Segment Example:

 
 import javafx.scene.shape.*;
 import javafx.animation.*;

 ...

     Rectangle rect = new Rectangle (100, 40, 100, 100);
     rect.setArcHeight(50);
     rect.setArcWidth(50);
     rect.setFill(Color.VIOLET);

     RotateTransition rt = new RotateTransition(Duration.millis(3000), rect);
     rt.setByAngle(180);
     rt.setCycleCount(4);
     rt.setAutoReverse(true);

     rt.play();

 ...

 
 
Since:
JavaFX 2.0
See Also: