Package org.pushingpixels.trident
Class Timeline
- java.lang.Object
-
- org.pushingpixels.trident.Timeline
-
- All Implemented Interfaces:
TimelineScenario.TimelineScenarioActor
- Direct Known Subclasses:
SwingRepaintTimeline,SWTRepaintTimeline
public class Timeline extends Object implements TimelineScenario.TimelineScenarioActor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTimeline.RepeatBehaviorstatic classTimeline.TimelineState
-
Field Summary
Fields Modifier and Type Field Description protected longidUnique ID.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()Aborts this timeline.voidaddCallback(TimelineCallback callback)<T> voidaddPropertyToInterpolate(String propName, KeyFrames<T> keyFrames)<T> voidaddPropertyToInterpolate(String propName, T from, T to)<T> voidaddPropertyToInterpolate(TimelinePropertyBuilder<T> propertyBuilder)voidcancel()Cancels this timeline.voidcancelAtCycleBreak()Requests that the specified timeline should stop at the end of the cycle.voidend()Ends this timeline.longgetDuration()floatgetDurationFraction()protected static longgetId()Returns a unique ID.ObjectgetMainObject()StringgetName()Timeline.TimelineStategetState()floatgetTimelinePosition()booleanisDone()voidplay()voidplayLoop(int loopCount, Timeline.RepeatBehavior repeatBehavior)voidplayLoop(Timeline.RepeatBehavior repeatBehavior)voidplayLoopSkipping(int loopCount, Timeline.RepeatBehavior repeatBehavior, long msToSkip)voidplayLoopSkipping(Timeline.RepeatBehavior repeatBehavior, long msToSkip)voidplayReverse()voidplayReverseSkipping(long msToSkip)voidplaySkipping(long msToSkip)static <T> TimelinePropertyBuilder<T>property(String propertyName)voidremoveCallback(TimelineCallback callback)voidreplay()voidreplayReverse()voidresetDoneFlag()voidresume()voidsetCycleDelay(long cycleDelay)voidsetDuration(long durationMs)voidsetEase(TimelineEase ease)voidsetInitialDelay(long initialDelay)voidsetName(String name)voidsetSecondaryID(Comparable<?> secondaryId)booleansupportsReplay()voidsuspend()StringtoString()
-
-
-
Constructor Detail
-
Timeline
public Timeline()
-
Timeline
public Timeline(Object mainTimelineObject)
-
-
Method Detail
-
setSecondaryID
public final void setSecondaryID(Comparable<?> secondaryId)
-
setDuration
public final void setDuration(long durationMs)
-
setInitialDelay
public final void setInitialDelay(long initialDelay)
-
setCycleDelay
public final void setCycleDelay(long cycleDelay)
-
addCallback
public final void addCallback(TimelineCallback callback)
-
removeCallback
public final void removeCallback(TimelineCallback callback)
-
property
public static <T> TimelinePropertyBuilder<T> property(String propertyName)
-
addPropertyToInterpolate
public final <T> void addPropertyToInterpolate(TimelinePropertyBuilder<T> propertyBuilder)
-
addPropertyToInterpolate
public final <T> void addPropertyToInterpolate(String propName, KeyFrames<T> keyFrames)
-
addPropertyToInterpolate
public final <T> void addPropertyToInterpolate(String propName, T from, T to)
-
play
public void play()
- Specified by:
playin 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
public void playLoop(Timeline.RepeatBehavior repeatBehavior)
-
playLoopSkipping
public void playLoopSkipping(Timeline.RepeatBehavior repeatBehavior, long msToSkip)
-
playLoop
public void playLoop(int loopCount, Timeline.RepeatBehavior repeatBehavior)
-
playLoopSkipping
public void playLoopSkipping(int loopCount, Timeline.RepeatBehavior repeatBehavior, long msToSkip)
-
cancel
public void cancel()
Cancels this timeline. The timeline transitions to theTimeline.TimelineState.CANCELLEDstate, preserving its current timeline position. After application callbacks and field interpolations are done on theTimeline.TimelineState.CANCELLEDstate, the timeline transitions to theTimeline.TimelineState.IDLEstate. Application callbacks and field interpolations are done on this state as well.
-
end
public void end()
Ends this timeline. The timeline transitions to theTimeline.TimelineState.DONEstate, 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.DONEstate, the timeline transitions to theTimeline.TimelineState.IDLEstate. Application callbacks and field interpolations are done on this state as well.
-
abort
public void abort()
Aborts this timeline. The timeline transitions to theTimeline.TimelineState.IDLEstate. No application callbacks or field interpolations are done.
-
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
public final Timeline.TimelineState getState()
-
setEase
public final void setEase(TimelineEase ease)
-
isDone
public boolean isDone()
- Specified by:
isDonein interfaceTimelineScenario.TimelineScenarioActor
-
supportsReplay
public boolean supportsReplay()
- Specified by:
supportsReplayin interfaceTimelineScenario.TimelineScenarioActor
-
resetDoneFlag
public void resetDoneFlag()
- Specified by:
resetDoneFlagin interfaceTimelineScenario.TimelineScenarioActor
-
getDuration
public final long getDuration()
-
getName
public String getName()
-
setName
public void setName(String name)
-
getMainObject
public Object getMainObject()
-
-