Package org.pushingpixels.trident
Class Timeline
java.lang.Object
org.pushingpixels.trident.Timeline
- All Implemented Interfaces:
TimelineScenario.TimelineScenarioActor
- Direct Known Subclasses:
SwingRepaintTimeline
,SWTRepaintTimeline
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Aborts this timeline.final void
addCallback
(TimelineCallback callback) final <T> void
addPropertyToInterpolate
(String propName, KeyFrames<T> keyFrames) final <T> void
addPropertyToInterpolate
(String propName, T from, T to) final <T> void
addPropertyToInterpolate
(TimelinePropertyBuilder<T> propertyBuilder) void
cancel()
Cancels this timeline.void
Requests that the specified timeline should stop at the end of the cycle.void
end()
Ends this timeline.final long
final float
protected static long
getId()
Returns a unique ID.getName()
final Timeline.TimelineState
getState()
final float
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
void
playReverseSkipping
(long msToSkip) void
playSkipping
(long msToSkip) static <T> TimelinePropertyBuilder
<T> final void
removeCallback
(TimelineCallback callback) void
replay()
void
void
void
resume()
final void
setCycleDelay
(long cycleDelay) final void
setDuration
(long durationMs) final void
setEase
(TimelineEase ease) final void
setInitialDelay
(long initialDelay) void
final void
setSecondaryID
(Comparable<?> secondaryId) boolean
void
suspend()
toString()
-
Field Details
-
id
protected long idUnique ID.
-
-
Constructor Details
-
Timeline
public Timeline() -
Timeline
-
-
Method Details
-
setSecondaryID
-
setDuration
public final void setDuration(long durationMs) -
setInitialDelay
public final void setInitialDelay(long initialDelay) -
setCycleDelay
public final void setCycleDelay(long cycleDelay) -
addCallback
-
removeCallback
-
property
-
addPropertyToInterpolate
-
addPropertyToInterpolate
-
addPropertyToInterpolate
-
play
public void play()- Specified by:
play
in interfaceTimelineScenario.TimelineScenarioActor
-
playSkipping
public void playSkipping(long msToSkip) -
playReverse
public void playReverse() -
playReverseSkipping
public void playReverseSkipping(long msToSkip) -
replay
public void replay() -
replayReverse
public void replayReverse() -
playLoop
-
playLoopSkipping
-
playLoop
-
playLoopSkipping
-
cancel
public void cancel()Cancels this timeline. The timeline transitions to theTimeline.TimelineState.CANCELLED
state, preserving its current timeline position. After application callbacks and field interpolations are done on theTimeline.TimelineState.CANCELLED
state, the timeline transitions to theTimeline.TimelineState.IDLE
state. Application callbacks and field interpolations are done on this state as well.- See Also:
-
end
public void end()Ends this timeline. The timeline transitions to theTimeline.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 theTimeline.TimelineState.DONE
state, the timeline transitions to theTimeline.TimelineState.IDLE
state. Application callbacks and field interpolations are done on this state as well.- See Also:
-
abort
public void abort()Aborts this timeline. The timeline transitions to theTimeline.TimelineState.IDLE
state. No application callbacks or field interpolations are done.- See Also:
-
suspend
public void suspend() -
resume
public void resume() -
cancelAtCycleBreak
public void cancelAtCycleBreak()Requests that the specified timeline should stop at the end of the cycle. This method should be called only on looping timelines. -
getId
protected static long getId()Returns a unique ID.- Returns:
- Unique ID.
-
getTimelinePosition
public final float getTimelinePosition() -
getDurationFraction
public final float getDurationFraction() -
getState
-
setEase
-
isDone
public boolean isDone()- Specified by:
isDone
in interfaceTimelineScenario.TimelineScenarioActor
-
supportsReplay
public boolean supportsReplay()- Specified by:
supportsReplay
in interfaceTimelineScenario.TimelineScenarioActor
-
resetDoneFlag
public void resetDoneFlag()- Specified by:
resetDoneFlag
in interfaceTimelineScenario.TimelineScenarioActor
-
toString
-
getDuration
public final long getDuration() -
getName
-
setName
-
getMainObject
-