org.pushingpixels.trident
public class Timeline extends Object implements TimelineScenario.TimelineScenarioActor
Modifier and Type | Class and Description |
---|---|
static class |
Timeline.RepeatBehavior |
static class |
Timeline.TimelineState |
Modifier and Type | Field and Description |
---|---|
protected long |
id
Unique ID.
|
Constructor and Description |
---|
Timeline() |
Timeline(Object mainTimelineObject) |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Aborts this timeline.
|
void |
addCallback(TimelineCallback callback) |
<T> void |
addPropertyToInterpolate(String propName,
KeyFrames<T> keyFrames) |
<T> void |
addPropertyToInterpolate(String propName,
T from,
T to) |
<T> void |
addPropertyToInterpolate(TimelinePropertyBuilder<T> propertyBuilder) |
void |
cancel()
Cancels this timeline.
|
void |
cancelAtCycleBreak()
Requests that the specified timeline should stop at the end of the cycle.
|
void |
end()
Ends this timeline.
|
long |
getDuration() |
float |
getDurationFraction() |
protected static long |
getId()
Returns a unique ID.
|
Object |
getMainObject() |
String |
getName() |
Timeline.TimelineState |
getState() |
float |
getTimelinePosition() |
boolean |
isDone() |
void |
play() |
void |
playLoop(int loopCount,
Timeline.RepeatBehavior repeatBehavior) |
void |
playLoop(Timeline.RepeatBehavior repeatBehavior) |
void |
playLoopSkipping(int loopCount,
Timeline.RepeatBehavior repeatBehavior,
long msToSkip) |
void |
playLoopSkipping(Timeline.RepeatBehavior repeatBehavior,
long msToSkip) |
void |
playReverse() |
void |
playReverseSkipping(long msToSkip) |
void |
playSkipping(long msToSkip) |
static <T> TimelinePropertyBuilder<T> |
property(String propertyName) |
void |
removeCallback(TimelineCallback callback) |
void |
replay() |
void |
replayReverse() |
void |
resetDoneFlag() |
void |
resume() |
void |
setCycleDelay(long cycleDelay) |
void |
setDuration(long durationMs) |
void |
setEase(TimelineEase ease) |
void |
setInitialDelay(long initialDelay) |
void |
setName(String name) |
void |
setSecondaryID(Comparable<?> secondaryId) |
boolean |
supportsReplay() |
void |
suspend() |
String |
toString() |
public Timeline()
public Timeline(Object mainTimelineObject)
public final void setSecondaryID(Comparable<?> secondaryId)
public final void setDuration(long durationMs)
public final void setInitialDelay(long initialDelay)
public final void setCycleDelay(long cycleDelay)
public final void addCallback(TimelineCallback callback)
public final void removeCallback(TimelineCallback callback)
public static <T> TimelinePropertyBuilder<T> property(String propertyName)
public final <T> void addPropertyToInterpolate(TimelinePropertyBuilder<T> propertyBuilder)
public final <T> void addPropertyToInterpolate(String propName, KeyFrames<T> keyFrames)
public final <T> void addPropertyToInterpolate(String propName, T from, T to)
public void play()
play
in interface TimelineScenario.TimelineScenarioActor
public void playSkipping(long msToSkip)
public void playReverse()
public void playReverseSkipping(long msToSkip)
public void replay()
public void replayReverse()
public void playLoop(Timeline.RepeatBehavior repeatBehavior)
public void playLoopSkipping(Timeline.RepeatBehavior repeatBehavior, long msToSkip)
public void playLoop(int loopCount, Timeline.RepeatBehavior repeatBehavior)
public void playLoopSkipping(int loopCount, Timeline.RepeatBehavior repeatBehavior, long msToSkip)
public void cancel()
Timeline.TimelineState.CANCELLED
state, preserving its current timeline
position. After application callbacks and field interpolations are done
on the Timeline.TimelineState.CANCELLED
state, the timeline transitions to
the Timeline.TimelineState.IDLE
state. Application callbacks and field
interpolations are done on this state as well.public void end()
Timeline.TimelineState.DONE
state, with the timeline position set to 0.0
or 1.0 - based on the direction of the timeline. After application
callbacks and field interpolations are done on the
Timeline.TimelineState.DONE
state, the timeline transitions to the
Timeline.TimelineState.IDLE
state. Application callbacks and field
interpolations are done on this state as well.public void abort()
Timeline.TimelineState.IDLE
state. No application callbacks or field
interpolations are done.public void suspend()
public void resume()
public void cancelAtCycleBreak()
protected static long getId()
public final float getTimelinePosition()
public final float getDurationFraction()
public final Timeline.TimelineState getState()
public final void setEase(TimelineEase ease)
public boolean isDone()
isDone
in interface TimelineScenario.TimelineScenarioActor
public boolean supportsReplay()
supportsReplay
in interface TimelineScenario.TimelineScenarioActor
public void resetDoneFlag()
resetDoneFlag
in interface TimelineScenario.TimelineScenarioActor
public final long getDuration()
public String getName()
public void setName(String name)
public Object getMainObject()