Java Reference
In-Depth Information
The getter and setter methods for property
values and a getter for property itself are provided
in the class, but omitted in the UML diagram for brevity.
javafx.animation.Animation
-autoReverse: BooleanProperty
-cycleCount: IntegerProperty
-rate: DoubleProperty
-status: ReadOnlyObjectProperty
<Animation.Status>
Defines whether the animation reverses direction on alternating cycles.
Defines the number of cycles in this animation.
Defines the speed and direction for this animation.
Read-only property to indicate the status of the animation.
+pause(): void
+play(): void
+stop(): void
Pauses the animation.
Plays the animation from the current position.
Stops the animation and resets the animation.
F
IGURE
15.15
The abstract
Animation
class is the root class for JavaFX animations.
The
autoReverse
is a Boolean property that indicates whether an animation will reverse
its direction on the next cycle. The
cycleCount
indicates the number of the cycles for the
animation. You can use the constant
Timeline.INDEFINTE
to indicate an indefinite num-
ber of cycles. The
rate
defines the speed of the animation. A negative rate value indicates
the opposite direction for the animation. The
status
is a read-only property that indicates
the status of the animation (
Animation.Status.PAUSED
,
Animation.Status.RUNNING
,
and
Animation.Status.STOPPED
). The methods
pause()
,
play()
, and
stop()
pauses,
plays, and stops an animation.
15.11.1
PathTransition
The
PathTransition
class animates the the moves of a node along a path from one end to
the other over a given time.
PathTransition
is a subtype of
Animation
. The UML class
diagram for the class is shown in FigureĀ 15.16.
The getter and setter methods for property
values and a getter for property itself are provided
in the class, but omitted in the UML diagram for brevity.
javafx.animation.PathTransition
-duration: ObjectProperty<Duration>
-node: ObjectProperty<Node>
-orientation: ObjectProperty
<PathTransition.OrientationType>
-path: ObjectType<Shape>
The duration of this transition.
The target node of this transition.
The orientation of the node along the path.
The shape whose outline is used as a path to animate the node move.
+PathTransition()
+PathTransition(duration: Duration,
path: Shape)
+PathTransition(duration: Duration,
path: Shape, node: Node)
Creates an empty
PathTransition
.
Creates a
PathTransition
with the specified duration and path.
Creates a
PathTransition
with the specified duration, path, and node.
F
IGURE
15.16
The
PathTransition
class defines an animation for a node along a path.
The
Duration
class defines a duration of time. It is an immutable class. The class defines
constants
INDEFINTE
,
ONE
,
UNKNOWN
, and
ZERO
to represent an indefinte duration, 1 milli-
seconds, unknow, and 0 duration. You can use
new Duration(double millis)
to create
Search WWH ::
Custom Search