Package javafx.animation
Class KeyValue
java.lang.Object
javafx.animation.KeyValue
Defines a key value to be interpolated for a particular interval along the
animation. A
KeyFrame
, which defines a specific point on a timeline,
can hold multiple KeyValues
. KeyValue
is an immutable class.
A KeyValue
is defined by a target, which is an implementation of
WritableValue
, an end value and an
Interpolator
.
Most interpolators define the interpolation between two KeyFrames
.
(The only exception are tangent-interpolators.)
The KeyValue
of the second KeyFrame
(in forward
direction) specifies the interpolator to be used in the interval.
Tangent-interpolators define the interpolation to the left and to the right of
a KeyFrame
(see
).
invalid @link
Interpolator.TANGENT
By default, Interpolator.LINEAR
is used in the interval.
- Since:
- JavaFX 2.0
- See Also:
-
Constructor Summary
ConstructorDescriptionKeyValue
(WritableValue<T> target, T endValue) Creates aKeyValue
that usesInterpolator.LINEAR
.KeyValue
(WritableValue<T> target, T endValue, Interpolator interpolator) Creates aKeyValue
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether some other object is "equal to" this one.Returns the end value of thisKeyValue
Interpolator
to be used for calculating the key value along the particular interval.Returns the target of thisKeyValue
int
hashCode()
Returns a hash code for thisKeyValue
object.toString()
Returns a string representation of thisKeyValue
object.
-
Constructor Details
-
KeyValue
Creates aKeyValue
.- Parameters:
target
- the targetendValue
- the end valueinterpolator
- theInterpolator
- Throws:
NullPointerException
- iftarget
orinterpolator
arenull
-
KeyValue
Creates aKeyValue
that usesInterpolator.LINEAR
.- Parameters:
target
- the targetendValue
- the end value- Throws:
NullPointerException
- iftarget
orinterpolator
arenull
-
-
Method Details
-
getTarget
Returns the target of thisKeyValue
- Returns:
- the target
-
getEndValue
Returns the end value of thisKeyValue
- Returns:
- the end value
-
getInterpolator
Interpolator
to be used for calculating the key value along the particular interval. By default,Interpolator.LINEAR
is used. -
toString
Returns a string representation of thisKeyValue
object. -
hashCode
public int hashCode()Returns a hash code for thisKeyValue
object. -
equals
Indicates whether some other object is "equal to" this one. TwoKeyValues
are considered equal, if theirtarget
,endValue
, andinterpolator
are equal.
-