Top Description Fields Constructors Methods
javafx.animation

public final Class ParallelTransition

extends Transition
Class Inheritance
Imports
com.sun.javafx.animation.TickCalculation, javafx.beans.InvalidationListener, javafx.beans.property.ObjectProperty, javafx.collections.ListChangeListener.Change, .ObservableList, javafx.event.ActionEvent, .EventHandler, javafx.scene.Node, javafx.util.Duration, com.sun.javafx.collections.TrackableObservableList, .VetoableListDecorator, com.sun.scenario.animation.AbstractPrimaryTimer, java.util.HashSet, .List, .Set, javafx.beans.value.ChangeListener, .ObservableValue

This Transition plays a list of Animations in parallel.

Children of this Transition inherit node, if their node property is not specified.

Code Segment Example:


    Rectangle rect = new Rectangle (100, 40, 100, 100);
    rect.setArcHeight(50);
    rect.setArcWidth(50);
    rect.setFill(Color.VIOLET);

    final Duration SEC_2 = Duration.millis(2000);
    final Duration SEC_3 = Duration.millis(3000);

    FadeTransition ft = new FadeTransition(SEC_3);
    ft.setFromValue(1.0f);
    ft.setToValue(0.3f);
    ft.setCycleCount(2f);
    ft.setAutoReverse(true);
    TranslateTransition tt = new TranslateTransition(SEC_2);
    tt.setFromX(-100f);
    tt.setToX(100f);
    tt.setCycleCount(2f);
    tt.setAutoReverse(true);
    RotateTransition rt = new RotateTransition(SEC_3);
    rt.setByAngle(180f);
    rt.setCycleCount(4f);
    rt.setAutoReverse(true);
    ScaleTransition st = new ScaleTransition(SEC_2);
    st.setByX(1.5f);
    st.setByY(1.5f);
    st.setCycleCount(2f);
    st.setAutoReverse(true);

    ParallelTransition pt = new ParallelTransition(rect, ft, tt, rt, st);
    pt.play();

Since
JavaFX 2.0
See Also
Transition, Animation

Field Summary

Modifier and TypeField and Description
private Animation[]
private final ObservableList<Animation>
private boolean
private final InvalidationListener
private final Set<Animation>
private long
private static final Node
private long[]
private long[]
private static final Animation[]
private static final double
private boolean[]
private ObjectProperty<Node>
node

This javafx.scene.Node is used in all child Transitions, that do not define a target Node themselves.

private long[]
private long
private final ChangeListener<Number>
private double[]
private boolean

Constructor Summary

AccessConstructor and Description
public
ParallelTransition(Node
The target javafx.scene.Node to be used in child Transitions that have no Node specified themselves
node
,
Animation...
The child Animations of this ParallelTransition
children
)

The constructor of ParallelTransition.

public
ParallelTransition(Animation...
The child Animations of this ParallelTransition
children
)

The constructor of ParallelTransition.

public
ParallelTransition(Node
The target javafx.scene.Node to be used in child Transitions that have no Node specified themselves
node
)

The constructor of ParallelTransition.

public
ParallelTransition()

The constructor of ParallelTransition.

pack-priv

Method Summary

Modifier and TypeMethod and Description
private double
calculateFraction(long currentTicks, long cycleTicks)

Hides javafx.animation.Transition.calculateFraction.

private static boolean
private Duration
pack-priv void
doJumpTo(long currentTicks, long cycleTicks, boolean forceJump)

Overrides javafx.animation.Transition.doJumpTo.

pack-priv void
pack-priv void
doPlayTo(long currentTicks, long cycleTicks)

Overrides javafx.animation.Transition.doPlayTo.

pack-priv void
pack-priv void
doStart(boolean forceSync)

Overrides javafx.animation.Animation.doStart.

pack-priv void
public final ObservableList<Animation>

Returns:

the list of Animations
getChildren
()

A list of Animations that will be played sequentially.

public final Node
protected Node
getParentTargetNode()

Overrides javafx.animation.Transition.getParentTargetNode.

Returns the first non-null target Node in the parent hierarchy of this Transition, or null if such a node is not found.

protected void
interpolate(double frac)

Implements abstract javafx.animation.Transition.interpolate.

The method interpolate() has to be provided by implementations of Transition.

private void
private void
public final ObjectProperty<Node>
public final void
setNode(Node value)

private boolean
startChild(Animation child, int index)

pack-priv void
sync(boolean forceSync)

Overrides javafx.animation.Transition.sync.

Inherited from javafx.animation.Transition:
getCachedInterpolatorgetInterpolatorinterpolatorPropertysetInterpolatorstartable

Field Detail

cachedChildrenback to summary
private Animation[] cachedChildren
childrenback to summary
private final ObservableList<Animation> children
childrenChangedback to summary
private boolean childrenChanged
childrenListenerback to summary
private final InvalidationListener childrenListener
childrenSetback to summary
private final Set<Animation> childrenSet
cycleTimeback to summary
private long cycleTime
DEFAULT_NODEback to summary
private static final Node DEFAULT_NODE
delaysback to summary
private long[] delays
durationsback to summary
private long[] durations
EMPTY_ANIMATION_ARRAYback to summary
private static final Animation[] EMPTY_ANIMATION_ARRAY
EPSILONback to summary
private static final double EPSILON

Hides javafx.animation.Animation.EPSILON.

forceChildSyncback to summary
private boolean[] forceChildSync
nodeback to summary
private ObjectProperty<Node> node

This javafx.scene.Node is used in all child Transitions, that do not define a target Node themselves. This can be used if a number of Transitions should be applied to a single Node.

It is not possible to change the target node of a running Transition. If the value of node is changed for a running Transition, the animation has to be stopped and started again to pick up the new value.

offsetTicksback to summary
private long[] offsetTicks
oldTicksback to summary
private long oldTicks
rateListenerback to summary
private final ChangeListener<Number> rateListener
ratesback to summary
private double[] rates
toggledRateback to summary
private boolean toggledRate

Constructor Detail

ParallelTransitionback to summary
public ParallelTransition(Node node, Animation... children)

The constructor of ParallelTransition.

Parameters
node:Node

The target javafx.scene.Node to be used in child Transitions that have no Node specified themselves

children:Animation[]

The child Animations of this ParallelTransition

ParallelTransitionback to summary
public ParallelTransition(Animation... children)

The constructor of ParallelTransition.

Parameters
children:Animation[]

The child Animations of this ParallelTransition

ParallelTransitionback to summary
public ParallelTransition(Node node)

The constructor of ParallelTransition.

Parameters
node:Node

The target javafx.scene.Node to be used in child Transitions that have no Node specified themselves

ParallelTransitionback to summary
public ParallelTransition()

The constructor of ParallelTransition.

ParallelTransitionback to summary
pack-priv ParallelTransition(AbstractPrimaryTimer timer)

Method Detail

calculateFractionback to summary
private double calculateFraction(long currentTicks, long cycleTicks)

Hides javafx.animation.Transition.calculateFraction.

checkCycleback to summary
private static boolean checkCycle(Animation child, Animation parent)
computeCycleDurationback to summary
private Duration computeCycleDuration()
doJumpToback to summary
pack-priv void doJumpTo(long currentTicks, long cycleTicks, boolean forceJump)

Overrides javafx.animation.Transition.doJumpTo.

Annotations
@Override
doPauseback to summary
pack-priv void doPause()

Overrides javafx.animation.Animation.doPause.

Annotations
@Override
doPlayToback to summary
pack-priv void doPlayTo(long currentTicks, long cycleTicks)

Overrides javafx.animation.Transition.doPlayTo.

Annotations
@Override
doResumeback to summary
pack-priv void doResume()

Overrides javafx.animation.Animation.doResume.

Annotations
@Override
doStartback to summary
pack-priv void doStart(boolean forceSync)

Overrides javafx.animation.Animation.doStart.

Annotations
@Override
doStopback to summary
pack-priv void doStop()

Overrides javafx.animation.Animation.doStop.

Annotations
@Override
getChildrenback to summary
public final ObservableList<Animation> getChildren()

A list of Animations that will be played sequentially.

It is not possible to change the children of a running ParallelTransition. If the children are changed for a running ParallelTransition, the animation has to be stopped and started again to pick up the new value.

Returns:ObservableList<Animation>

the list of Animations

getNodeback to summary
public final Node getNode()
getParentTargetNodeback to summary
protected Node getParentTargetNode()

Overrides javafx.animation.Transition.getParentTargetNode.

Doc from javafx.animation.Transition.getParentTargetNode.

Returns the first non-null target Node in the parent hierarchy of this Transition, or null if such a node is not found.

A parent animation is one that can have child animations. Examples are SequentialTransition and ParallelTransition. A parent animation can also be a child of another parent animation.

Note that if this Transition has a target node set and is not a parent animation, it will be ignored during the call as this method only queries parent animations.

Annotations
@Override
interpolateback to summary
protected void interpolate(double frac)

Implements abstract javafx.animation.Transition.interpolate.

Doc from javafx.animation.Transition.interpolate.

The method interpolate() has to be provided by implementations of Transition. While a Transition is running, this method is called in every frame. The parameter defines the current position with the animation. At the start, the fraction will be 0.0 and at the end it will be 1.0. How the parameter increases, depends on the interpolator, e.g. if the interpolator is Interpolator#LINEAR, the fraction will increase linear. This method must not be called by the user directly.

Annotations
@Override
jumpToEndback to summary
private void jumpToEnd()
jumpToStartback to summary
private void jumpToStart()
nodePropertyback to summary
public final ObjectProperty<Node> nodeProperty()
setNodeback to summary
public final void setNode(Node value)
startChildback to summary
private boolean startChild(Animation child, int index)
syncback to summary
pack-priv void sync(boolean forceSync)

Overrides javafx.animation.Transition.sync.

Annotations
@Override