Enum Class AnimationFactory
- All Implemented Interfaces:
Serializable,Comparable<AnimationFactory>,Constable
Nodes.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic doubleThis special variable is used in slide animations when the "travel distance" is computed.static final javafx.animation.Interpolatorstatic final javafx.animation.Interpolator -
Method Summary
Modifier and TypeMethodDescriptionjavafx.animation.Timelinebuild(javafx.scene.Node node, double millis) Callsbuild(Node, double, Interpolator)withINTERPOLATOR_V1as the default interpolator.javafx.animation.Timelinebuild(javafx.scene.Node node, double millis, javafx.animation.Interpolator i) Each enum constant will produce aTimelinewith the given parameters.javafx.animation.Timelinebuild(javafx.scene.Node node, javafx.util.Duration duration) Callsbuild(Node, double)with the given duration converted to milliseconds.javafx.animation.Timelinebuild(javafx.scene.Node node, javafx.util.Duration duration, javafx.animation.Interpolator i) Callsbuild(Node, double, Interpolator)with the given duration converted to milliseconds and the given interpolator.doublecomputeDistanceBottom(javafx.scene.Node node) Computes the distance between the node and the bottom side of its parent.doublecomputeDistanceLeft(javafx.scene.Node node) Computes the distance between the node and the left side of its parent by using itsNode.boundsInParentProperty().doublecomputeDistanceRight(javafx.scene.Node node) Computes the distance between the node and the right side of its parent.doublecomputeDistanceTop(javafx.scene.Node node) Computes the distance between the node and the top side of its parent by using itsNode.boundsInParentProperty().abstract javafx.animation.KeyFrame[]keyFrames(javafx.scene.Node node, double millis, javafx.animation.Interpolator i) Each enum constant should produce the KeyFrames for the animation from the given parameters.static AnimationFactoryReturns the enum constant of this class with the specified name.static AnimationFactory[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FADE_IN
-
FADE_OUT
-
SLIDE_IN_BOTTOM
-
SLIDE_OUT_BOTTOM
-
SLIDE_IN_LEFT
-
SLIDE_OUT_LEFT
-
SLIDE_IN_RIGHT
-
SLIDE_OUT_RIGHT
-
SLIDE_IN_TOP
-
SLIDE_OUT_TOP
-
-
Field Details
-
INTERPOLATOR_V1
public static final javafx.animation.Interpolator INTERPOLATOR_V1 -
INTERPOLATOR_V2
public static final javafx.animation.Interpolator INTERPOLATOR_V2 -
extraOffset
public static double extraOffsetThis special variable is used in slide animations when the "travel distance" is computed. This extra offset is added to the computed value to ensure the node is outside the parent, for a smooth animation.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
computeDistanceLeft
public double computeDistanceLeft(javafx.scene.Node node) Computes the distance between the node and the left side of its parent by using itsNode.boundsInParentProperty(). This distance ensures the node is going to be outside/inside the parent towards the animation's ending.- See Also:
-
computeDistanceRight
public double computeDistanceRight(javafx.scene.Node node) Computes the distance between the node and the right side of its parent. For this computation the
Node.parentProperty()must not return anullvalue (the node must be a child of some other node).If the parent is
null,a 'fallback' value is returned: the width of the node plus the extra offset.Otherwise, the value is computed like this:
parent.getLayoutBounds().getWidth() - node.getBoundsInParent().getMaxX() + node.getBoundsInParent().getWidth() + extraOffset- See Also:
-
computeDistanceTop
public double computeDistanceTop(javafx.scene.Node node) Computes the distance between the node and the top side of its parent by using itsNode.boundsInParentProperty(). This distance ensures the node is going to be outside/inside the parent towards the animation's ending.- See Also:
-
computeDistanceBottom
public double computeDistanceBottom(javafx.scene.Node node) Computes the distance between the node and the bottom side of its parent. For this computation the
Node.parentProperty()must not return anullvalue (the node must be a child of some other node).If the parent is
null, a 'fallback' value is returned: the height of the node plus the extra offset.Otherwise, the value is computed like this:
parent.getLayoutBounds().getHeight() - node.getBoundsInParent().getMaxY() + node.getBoundsInParent().getHeight() + extraOffset- See Also:
-
build
public javafx.animation.Timeline build(javafx.scene.Node node, double millis) Callsbuild(Node, double, Interpolator)withINTERPOLATOR_V1as the default interpolator. -
build
public javafx.animation.Timeline build(javafx.scene.Node node, javafx.util.Duration duration) Callsbuild(Node, double)with the given duration converted to milliseconds. -
build
public javafx.animation.Timeline build(javafx.scene.Node node, javafx.util.Duration duration, javafx.animation.Interpolator i) Callsbuild(Node, double, Interpolator)with the given duration converted to milliseconds and the given interpolator. -
build
public javafx.animation.Timeline build(javafx.scene.Node node, double millis, javafx.animation.Interpolator i) Each enum constant will produce aTimelinewith the given parameters.- Parameters:
node- theNodeon which perform the animationmillis- the duration of the animation in millisecondsi- theInterpolatorused by the animations
-
keyFrames
public abstract javafx.animation.KeyFrame[] keyFrames(javafx.scene.Node node, double millis, javafx.animation.Interpolator i) Each enum constant should produce the KeyFrames for the animation from the given parameters.
-