org.robokind.api.animation.player
Interface AnimationJob

All Superinterfaces:
org.robokind.api.common.playable.Playable

public interface AnimationJob
extends org.robokind.api.common.playable.Playable

An AnimationJob is able to play an animation for some rendering system.

Author:
Matthew Stevenson

Method Summary
 void addAnimationListener(AnimationJobListener listener)
          Adds an AnimationListener to be notified as the Animation advances.
 Map<Integer,Double> advanceAnimation(long time, long interval)
          Advances the Animation to the given time.
 Animation getAnimation()
          Returns the Animation this AnimationJob is playing.
 Long getAnimationLength()
          Returns the length of the Animation being played in milliseconds.
 boolean getLoop()
          Returns the looping status of the AnimationJob.
 Long getRemainingTime(long time)
          Returns the time remaining in the Animation at the given time in milliseconds.
 AnimationPlayer getSource()
          Returns the AnimationPlayer which created this AnimationJob.
 void removeAnimationListener(AnimationJobListener listener)
          Removes an AnimationListener from listening to the Animation.
 void setLoop(boolean loop)
          If set true, the AnimationJob will loop, replaying after finishing.
 
Methods inherited from interface org.robokind.api.common.playable.Playable
addPlayableListener, complete, getElapsedPauseTime, getElapsedPlayTime, getPauseTime, getPlayState, getResumeTime, getStartTime, getStopTime, pause, removePlayableListener, resume, start, stop
 

Method Detail

addAnimationListener

void addAnimationListener(AnimationJobListener listener)
Adds an AnimationListener to be notified as the Animation advances.

Parameters:
listener - AnimationListener to add

removeAnimationListener

void removeAnimationListener(AnimationJobListener listener)
Removes an AnimationListener from listening to the Animation.

Parameters:
listener - AnimationListener to remove

getAnimation

Animation getAnimation()
Returns the Animation this AnimationJob is playing.

Returns:
Animation this AnimationJob is playing

getAnimationLength

Long getAnimationLength()
Returns the length of the Animation being played in milliseconds.

Returns:
length of the Animation being played in milliseconds

getRemainingTime

Long getRemainingTime(long time)
Returns the time remaining in the Animation at the given time in milliseconds.

Parameters:
time - current time
Returns:
time remaining in the Animation at the given time in milliseconds

advanceAnimation

Map<Integer,Double> advanceAnimation(long time,
                                     long interval)
Advances the Animation to the given time.

Parameters:
time - current time
interval - preferred time between advancements
Returns:
resulting Animation goal positions

getSource

AnimationPlayer getSource()
Returns the AnimationPlayer which created this AnimationJob. This is used especially with OSGi to remove AnimationJobs from the Service Registry.

Returns:
AnimationPlayer which created this AnimationJob

setLoop

void setLoop(boolean loop)
If set true, the AnimationJob will loop, replaying after finishing.

Parameters:
loop - looping status

getLoop

boolean getLoop()
Returns the looping status of the AnimationJob.

Returns:
looping status of the AnimationJob


Copyright © 2011. All Rights Reserved.