Class KeyValue
- javafx.animation.KeyValue
public final class KeyValue extends Object
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 Interpolator.TANGENT).
By default, Interpolator.LINEAR is used in the interval.
Since:
JavaFX 2.0
See Also:
-
Constructor Summary
Constructors Constructor and Description KeyValue(WritableValue<T> target, T endValue)Creates aKeyValuethat usesInterpolator.LINEAR.KeyValue(WritableValue<T> target, T endValue, Interpolator interpolator)Creates aKeyValue.
-
Method Summary
All MethodsInstance MethodsConcrete Methods Modifier and Type Method and Description booleanequals(Object obj)Indicates whether some other object is "equal to" this one.ObjectgetEndValue()Returns the end value of thisKeyValueInterpolatorgetInterpolator()Interpolatorto be used for calculating the key value along the particular interval.WritableValue<?>getTarget()Returns the target of thisKeyValueinthashCode()Returns a hash code for thisKeyValueobject.StringtoString()Returns a string representation of thisKeyValueobject.
-
Constructor Detail
-
KeyValue
public KeyValue(WritableValue<T> target, T endValue, Interpolator interpolator)Creates aKeyValue.Parameters:
target- the targetThrows:
NullPointerException- iftargetorinterpolatorarenull
-
KeyValue
public KeyValue(WritableValue<T> target, T endValue)Creates aKeyValuethat usesInterpolator.LINEAR.Parameters:
target- the targetThrows:
NullPointerException- iftargetorinterpolatorarenull
-
-
Method Detail
-
getTarget
public WritableValue<?> getTarget()
Returns the target of thisKeyValueReturns:
the target
-
getEndValue
public Object getEndValue()
Returns the end value of thisKeyValueReturns:
the end value
-
getInterpolator
public Interpolator getInterpolator()
Interpolatorto be used for calculating the key value along the particular interval. By default,Interpolator.LINEARis used.
-
toString
public String toString()
Returns a string representation of thisKeyValueobject.
-
hashCode
public int hashCode()
Returns a hash code for thisKeyValueobject.
-
equals
public boolean equals(Object obj)
Indicates whether some other object is "equal to" this one. TwoKeyValuesare considered equal, if theirtarget,endValue, andinterpolatorare equal.
-
© 2008, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from JavaFX API Documentation.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Java, JavaFX and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.