- java.lang.Object
- 
- javafx.animation.Animation
- 
- javafx.animation.Transition
- 
- javafx.animation.RotateTransition
 
 
 
- 
 public final class RotateTransition extends Transition ThisTransitioncreates a rotation animation that spans itsduration. This is done by updating therotatevariable of thenodeat regular interval. The angle value is specified in degrees.It starts from the fromAngleif provided else uses thenode'srotatevalue.It stops at the toAnglevalue if provided else it will use start value plusbyAngle.The toAngletakes precedence if bothtoAngleandbyAngleare 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:
- Transition,- Animation
 
- 
- 
Property SummaryProperties Type Property Description ObjectProperty<Point3D>axisSpecifies the axis of rotation for thisRotateTransition.DoublePropertybyAngleSpecifies the incremented stop angle value, from the start, of thisRotateTransition.ObjectProperty<Duration>durationThe duration of thisRotateTransition.DoublePropertyfromAngleSpecifies the start angle value for thisRotateTransition.ObjectProperty<Node>nodeThe target node of thisRotateTransition.DoublePropertytoAngleSpecifies the stop angle value for thisRotateTransition.- 
Properties inherited from class javafx.animation.Transitioninterpolator
 - 
Properties inherited from class javafx.animation.AnimationautoReverse, currentRate, currentTime, cycleCount, cycleDuration, delay, onFinished, rate, status, totalDuration
 
- 
 - 
Nested Class Summary- 
Nested classes/interfaces inherited from class javafx.animation.AnimationAnimation.Status
 
- 
 - 
Field Summary- 
Fields inherited from class javafx.animation.AnimationINDEFINITE
 
- 
 - 
Constructor SummaryConstructors Constructor Description RotateTransition()The constructor ofRotateTransitionRotateTransition(Duration duration)The constructor ofRotateTransitionRotateTransition(Duration duration, Node node)The constructor ofRotateTransition
 - 
Method SummaryModifier and Type Method Description ObjectProperty<Point3D>axisProperty()Specifies the axis of rotation for thisRotateTransition.DoublePropertybyAngleProperty()Specifies the incremented stop angle value, from the start, of thisRotateTransition.ObjectProperty<Duration>durationProperty()The duration of thisRotateTransition.DoublePropertyfromAngleProperty()Specifies the start angle value for thisRotateTransition.Point3DgetAxis()Gets the value of the property axis.doublegetByAngle()Gets the value of the property byAngle.DurationgetDuration()Gets the value of the property duration.doublegetFromAngle()Gets the value of the property fromAngle.NodegetNode()Gets the value of the property node.doublegetToAngle()Gets the value of the property toAngle.protected voidinterpolate(double frac)The methodinterpolate()has to be provided by implementations ofTransition.ObjectProperty<Node>nodeProperty()The target node of thisRotateTransition.voidsetAxis(Point3D value)Sets the value of the property axis.voidsetByAngle(double value)Sets the value of the property byAngle.voidsetDuration(Duration value)Sets the value of the property duration.voidsetFromAngle(double value)Sets the value of the property fromAngle.voidsetNode(Node value)Sets the value of the property node.voidsetToAngle(double value)Sets the value of the property toAngle.DoublePropertytoAngleProperty()Specifies the stop angle value for thisRotateTransition.- 
Methods inherited from class javafx.animation.TransitiongetCachedInterpolator, getInterpolator, getParentTargetNode, interpolatorProperty, setInterpolator
 - 
Methods inherited from 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 Detail- 
nodepublic final ObjectProperty<Node> nodeProperty The 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:
- getNode(),- setNode(Node)
 
 - 
durationpublic final ObjectProperty<Duration> durationProperty The 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:
- getDuration(),- setDuration(Duration)
 
 - 
axispublic final ObjectProperty<Point3D> axisProperty Specifies 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:
- getAxis(),- setAxis(Point3D)
 
 - 
fromAnglepublic final DoubleProperty fromAngleProperty Specifies 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:
- getFromAngle(),- setFromAngle(double)
 
 - 
toAnglepublic final DoubleProperty toAngleProperty Specifies 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:
- getToAngle(),- setToAngle(double)
 
 - 
byAnglepublic final DoubleProperty byAngleProperty Specifies 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:
- getByAngle(),- setByAngle(double)
 
 
- 
 - 
Constructor Detail- 
RotateTransitionpublic RotateTransition(Duration duration, Node node) The constructor ofRotateTransition- Parameters:
- duration- The duration of the- RotateTransition
- node- The- nodewhich will be rotated
 
 - 
RotateTransitionpublic RotateTransition(Duration duration) The constructor ofRotateTransition- Parameters:
- duration- The duration of the- RotateTransition
 
 - 
RotateTransitionpublic RotateTransition() The constructor ofRotateTransition
 
- 
 - 
Method Detail- 
setNodepublic final void setNode(Node value) Sets the value of the property node.- 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.
 
 - 
getNodepublic final Node getNode() Gets the value of the property node.- 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.
 
 - 
nodePropertypublic final ObjectProperty<Node> nodeProperty() The 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:
- getNode(),- setNode(Node)
 
 - 
setDurationpublic final void setDuration(Duration value) Sets the value of the property duration.- 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
 
 - 
getDurationpublic final Duration getDuration() Gets the value of the property duration.- 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
 
 - 
durationPropertypublic final ObjectProperty<Duration> durationProperty() The 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:
- getDuration(),- setDuration(Duration)
 
 - 
setAxispublic final void setAxis(Point3D value) Sets the value of the property axis.- 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
 
 - 
getAxispublic final Point3D getAxis() Gets the value of the property axis.- 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
 
 - 
axisPropertypublic final ObjectProperty<Point3D> axisProperty() Specifies 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:
- getAxis(),- setAxis(Point3D)
 
 - 
setFromAnglepublic final void setFromAngle(double value) Sets the value of the property fromAngle.- 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
 
 - 
getFromAnglepublic final double getFromAngle() Gets the value of the property fromAngle.- 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
 
 - 
fromAnglePropertypublic final DoubleProperty fromAngleProperty() Specifies 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:
- getFromAngle(),- setFromAngle(double)
 
 - 
setToAnglepublic final void setToAngle(double value) Sets the value of the property toAngle.- 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
 
 - 
getToAnglepublic final double getToAngle() Gets the value of the property toAngle.- 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
 
 - 
toAnglePropertypublic final DoubleProperty toAngleProperty() Specifies 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:
- getToAngle(),- setToAngle(double)
 
 - 
setByAnglepublic final void setByAngle(double value) Sets the value of the property byAngle.- 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.
 
 - 
getByAnglepublic final double getByAngle() Gets the value of the property byAngle.- 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.
 
 - 
byAnglePropertypublic final DoubleProperty byAngleProperty() Specifies 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:
- getByAngle(),- setByAngle(double)
 
 - 
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
 
 
- 
 
-