Class RotateTransition
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:
- 
Nested Class SummaryNested classes/interfaces declared in class javafx.animation.AnimationAnimation.Status
- 
Property SummaryPropertiesTypePropertyDescriptionfinal ObjectProperty<Point3D> Specifies the axis of rotation for thisRotateTransition.final DoublePropertySpecifies the incremented stop angle value, from the start, of thisRotateTransition.final ObjectProperty<Duration> The duration of thisRotateTransition.final DoublePropertySpecifies the start angle value for thisRotateTransition.final ObjectProperty<Node> The target node of thisRotateTransition.final DoublePropertySpecifies the stop angle value for thisRotateTransition.Properties declared in class javafx.animation.TransitioninterpolatorProperties declared in class javafx.animation.AnimationautoReverse, currentRate, currentTime, cycleCount, cycleDuration, delay, onFinished, rate, status, totalDuration
- 
Field SummaryFields declared in class javafx.animation.AnimationINDEFINITE
- 
Constructor SummaryConstructorsConstructorDescriptionThe constructor ofRotateTransitionRotateTransition(Duration duration) The constructor ofRotateTransitionRotateTransition(Duration duration, Node node) The constructor ofRotateTransition
- 
Method SummaryModifier and TypeMethodDescriptionfinal ObjectProperty<Point3D> Specifies the axis of rotation for thisRotateTransition.final DoublePropertySpecifies the incremented stop angle value, from the start, of thisRotateTransition.final ObjectProperty<Duration> The duration of thisRotateTransition.final DoublePropertySpecifies the start angle value for thisRotateTransition.final Point3DgetAxis()Gets the value of theaxisproperty.final doubleGets the value of thebyAngleproperty.final DurationGets the value of thedurationproperty.final doubleGets the value of thefromAngleproperty.final NodegetNode()Gets the value of thenodeproperty.final doubleGets the value of thetoAngleproperty.protected voidinterpolate(double frac) The methodinterpolate()has to be provided by implementations ofTransition.final ObjectProperty<Node> The target node of thisRotateTransition.final voidSets the value of theaxisproperty.final voidsetByAngle(double value) Sets the value of thebyAngleproperty.final voidsetDuration(Duration value) Sets the value of thedurationproperty.final voidsetFromAngle(double value) Sets the value of thefromAngleproperty.final voidSets the value of thenodeproperty.final voidsetToAngle(double value) Sets the value of thetoAngleproperty.final DoublePropertySpecifies the stop angle value for thisRotateTransition.Methods declared in class javafx.animation.TransitiongetCachedInterpolator, getInterpolator, getParentTargetNode, interpolatorProperty, setInterpolatorMethods declared in class javafx.animation.AnimationautoReverseProperty, currentRateProperty, currentTimeProperty, cycleCountProperty, cycleDurationProperty, delayProperty, getCuePoints, getCurrentRate, getCurrentTime, getCycleCount, getCycleDuration, getDelay, getOnFinished, getRate, getStatus, getTargetFramerate, getTotalDuration, isAutoReverse, jumpTo, jumpTo, onFinishedProperty, pause, play, playFrom, playFrom, playFromStart, rateProperty, setAutoReverse, setCycleCount, setCycleDuration, setDelay, setOnFinished, setRate, setStatus, statusProperty, stop, totalDurationProperty
- 
Property Details- 
nodeThe target node of thisRotateTransition.It is not possible to change the target nodeof a runningRotateTransition. If the value ofnodeis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- See Also:
 
- 
durationThe duration of thisRotateTransition.It is not possible to change the durationof a runningRotateTransition. If the value ofdurationis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.Note: While the unit of durationis a millisecond, the granularity depends on the underlying operating system and will in general be larger. For example animations on desktop systems usually run with a maximum of 60fps which gives a granularity of ~17 ms. Setting duration to value lower thanDuration.ZEROwill result inIllegalArgumentException.- Default value:
- 400ms
- See Also:
 
- 
axisSpecifies the axis of rotation for thisRotateTransition. Usenode.rotationAxisfor axis of rotation if thisaxisis null.It is not possible to change the axisof a runningRotateTransition. If the value ofaxisis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Default value:
- null
- See Also:
 
- 
fromAngleSpecifies the start angle value for thisRotateTransition.It is not possible to change fromAngleof a runningRotateTransition. If the value offromAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Default value:
- Double.NaN
- See Also:
 
- 
toAngleSpecifies the stop angle value for thisRotateTransition.It is not possible to change toAngleof a runningRotateTransition. If the value oftoAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Default value:
- Double.NaN
- See Also:
 
- 
byAngleSpecifies the incremented stop angle value, from the start, of thisRotateTransition.It is not possible to change byAngleof a runningRotateTransition. If the value ofbyAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- See Also:
 
 
- 
- 
Constructor Details- 
RotateTransition
- 
RotateTransitionThe constructor ofRotateTransition- Parameters:
- duration- The duration of the- RotateTransition
 
- 
RotateTransitionpublic RotateTransition()The constructor ofRotateTransition
 
- 
- 
Method Details- 
setNodeSets the value of thenodeproperty.- Property description:
- The target node of this RotateTransition.It is not possible to change the target nodeof a runningRotateTransition. If the value ofnodeis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Parameters:
- value- the value for the- nodeproperty
- See Also:
 
- 
getNodeGets the value of thenodeproperty.- Property description:
- The target node of this RotateTransition.It is not possible to change the target nodeof a runningRotateTransition. If the value ofnodeis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Returns:
- the value of the nodeproperty
- See Also:
 
- 
nodePropertyThe target node of thisRotateTransition.It is not possible to change the target nodeof a runningRotateTransition. If the value ofnodeis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Returns:
- the nodeproperty
- See Also:
 
- 
setDurationSets the value of thedurationproperty.- Property description:
- The duration of this RotateTransition.It is not possible to change the durationof a runningRotateTransition. If the value ofdurationis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.Note: While the unit of durationis a millisecond, the granularity depends on the underlying operating system and will in general be larger. For example animations on desktop systems usually run with a maximum of 60fps which gives a granularity of ~17 ms. Setting duration to value lower thanDuration.ZEROwill result inIllegalArgumentException.
- Default value:
- 400ms
- Parameters:
- value- the value for the- durationproperty
- See Also:
 
- 
getDurationGets the value of thedurationproperty.- Property description:
- The duration of this RotateTransition.It is not possible to change the durationof a runningRotateTransition. If the value ofdurationis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.Note: While the unit of durationis a millisecond, the granularity depends on the underlying operating system and will in general be larger. For example animations on desktop systems usually run with a maximum of 60fps which gives a granularity of ~17 ms. Setting duration to value lower thanDuration.ZEROwill result inIllegalArgumentException.
- Default value:
- 400ms
- Returns:
- the value of the durationproperty
- See Also:
 
- 
durationPropertyThe duration of thisRotateTransition.It is not possible to change the durationof a runningRotateTransition. If the value ofdurationis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.Note: While the unit of durationis a millisecond, the granularity depends on the underlying operating system and will in general be larger. For example animations on desktop systems usually run with a maximum of 60fps which gives a granularity of ~17 ms. Setting duration to value lower thanDuration.ZEROwill result inIllegalArgumentException.- Default value:
- 400ms
- Returns:
- the durationproperty
- See Also:
 
- 
setAxisSets the value of theaxisproperty.- Property description:
- Specifies the axis of rotation for this RotateTransition. Usenode.rotationAxisfor axis of rotation if thisaxisis null.It is not possible to change the axisof a runningRotateTransition. If the value ofaxisis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Default value:
- null
- Parameters:
- value- the value for the- axisproperty
- See Also:
 
- 
getAxisGets the value of theaxisproperty.- Property description:
- Specifies the axis of rotation for this RotateTransition. Usenode.rotationAxisfor axis of rotation if thisaxisis null.It is not possible to change the axisof a runningRotateTransition. If the value ofaxisis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Default value:
- null
- Returns:
- the value of the axisproperty
- See Also:
 
- 
axisPropertySpecifies the axis of rotation for thisRotateTransition. Usenode.rotationAxisfor axis of rotation if thisaxisis null.It is not possible to change the axisof a runningRotateTransition. If the value ofaxisis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Default value:
- null
- Returns:
- the axisproperty
- See Also:
 
- 
setFromAnglepublic final void setFromAngle(double value) Sets the value of thefromAngleproperty.- Property description:
- Specifies the start angle value for this RotateTransition.It is not possible to change fromAngleof a runningRotateTransition. If the value offromAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Default value:
- Double.NaN
- Parameters:
- value- the value for the- fromAngleproperty
- See Also:
 
- 
getFromAnglepublic final double getFromAngle()Gets the value of thefromAngleproperty.- Property description:
- Specifies the start angle value for this RotateTransition.It is not possible to change fromAngleof a runningRotateTransition. If the value offromAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Default value:
- Double.NaN
- Returns:
- the value of the fromAngleproperty
- See Also:
 
- 
fromAnglePropertySpecifies the start angle value for thisRotateTransition.It is not possible to change fromAngleof a runningRotateTransition. If the value offromAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Default value:
- Double.NaN
- Returns:
- the fromAngleproperty
- See Also:
 
- 
setToAnglepublic final void setToAngle(double value) Sets the value of thetoAngleproperty.- Property description:
- Specifies the stop angle value for this RotateTransition.It is not possible to change toAngleof a runningRotateTransition. If the value oftoAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Default value:
- Double.NaN
- Parameters:
- value- the value for the- toAngleproperty
- See Also:
 
- 
getToAnglepublic final double getToAngle()Gets the value of thetoAngleproperty.- Property description:
- Specifies the stop angle value for this RotateTransition.It is not possible to change toAngleof a runningRotateTransition. If the value oftoAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Default value:
- Double.NaN
- Returns:
- the value of the toAngleproperty
- See Also:
 
- 
toAnglePropertySpecifies the stop angle value for thisRotateTransition.It is not possible to change toAngleof a runningRotateTransition. If the value oftoAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Default value:
- Double.NaN
- Returns:
- the toAngleproperty
- See Also:
 
- 
setByAnglepublic final void setByAngle(double value) Sets the value of thebyAngleproperty.- Property description:
- Specifies the incremented stop angle value, from the start, of this
 RotateTransition.It is not possible to change byAngleof a runningRotateTransition. If the value ofbyAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Parameters:
- value- the value for the- byAngleproperty
- See Also:
 
- 
getByAnglepublic final double getByAngle()Gets the value of thebyAngleproperty.- Property description:
- Specifies the incremented stop angle value, from the start, of this
 RotateTransition.It is not possible to change byAngleof a runningRotateTransition. If the value ofbyAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.
- Returns:
- the value of the byAngleproperty
- See Also:
 
- 
byAnglePropertySpecifies the incremented stop angle value, from the start, of thisRotateTransition.It is not possible to change byAngleof a runningRotateTransition. If the value ofbyAngleis changed for a runningRotateTransition, the animation has to be stopped and started again to pick up the new value.- Returns:
- the byAngleproperty
- See Also:
 
- 
interpolateprotected void interpolate(double frac) The methodinterpolate()has to be provided by implementations ofTransition. While aTransitionis running, this method is called in every frame. The parameter defines the current position with the animation. At the start, the fraction will be0.0and at the end it will be1.0. How the parameter increases, depends on theinterpolator, e.g. if theinterpolatorisInterpolator.LINEAR, the fraction will increase linear. This method must not be called by the user directly.- Specified by:
- interpolatein class- Transition
- Parameters:
- frac- The relative position
 
 
-