org.robokind.api.animation.messaging
Class RemoteAnimationJob

java.lang.Object
  extended by org.robokind.api.common.playable.AbstractPlayable
      extended by org.robokind.api.animation.messaging.RemoteAnimationJob
All Implemented Interfaces:
AnimationJob, org.robokind.api.common.playable.Playable

public class RemoteAnimationJob
extends org.robokind.api.common.playable.AbstractPlayable
implements AnimationJob

Author:
matt

Field Summary
 
Fields inherited from class org.robokind.api.common.playable.AbstractPlayable
myElapsedPauseTime, myPauseTime, myPlayableListeners, myPlayState, myResumeTime, myStartTime, myStopTime
 
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.
 Long getCurrentTime(long time)
           
 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.
protected  boolean onComplete(long time)
           
protected  boolean onPause(long time)
           
protected  boolean onResume(long time)
           
 boolean onStart(long time)
           
protected  boolean onStop(long time)
           
 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 class org.robokind.api.common.playable.AbstractPlayable
addPlayableListener, afterComplete, complete, firePlayStateChanged, getElapsedPauseTime, getElapsedPlayTime, getPauseTime, getPlayState, getResumeTime, getStartTime, getStopTime, pause, removePlayableListener, resume, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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

getSource

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

Specified by:
getSource in interface AnimationJob
Returns:
AnimationPlayer which created this AnimationJob

addAnimationListener

public void addAnimationListener(AnimationJobListener listener)
Description copied from interface: AnimationJob
Adds an AnimationListener to be notified as the Animation advances.

Specified by:
addAnimationListener in interface AnimationJob
Parameters:
listener - AnimationListener to add

removeAnimationListener

public void removeAnimationListener(AnimationJobListener listener)
Description copied from interface: AnimationJob
Removes an AnimationListener from listening to the Animation.

Specified by:
removeAnimationListener in interface AnimationJob
Parameters:
listener - AnimationListener to remove

getAnimation

public Animation getAnimation()
Description copied from interface: AnimationJob
Returns the Animation this AnimationJob is playing.

Specified by:
getAnimation in interface AnimationJob
Returns:
Animation this AnimationJob is playing

getCurrentTime

public Long getCurrentTime(long time)

advanceAnimation

public Map<Integer,Double> advanceAnimation(long time,
                                            long interval)
Description copied from interface: AnimationJob
Advances the Animation to the given time.

Specified by:
advanceAnimation in interface AnimationJob
Parameters:
time - current time
interval - preferred time between advancements
Returns:
resulting Animation goal positions

onStart

public boolean onStart(long time)
Specified by:
onStart in class org.robokind.api.common.playable.AbstractPlayable

getAnimationLength

public Long getAnimationLength()
Description copied from interface: AnimationJob
Returns the length of the Animation being played in milliseconds.

Specified by:
getAnimationLength in interface AnimationJob
Returns:
length of the Animation being played in milliseconds

getRemainingTime

public Long getRemainingTime(long time)
Description copied from interface: AnimationJob
Returns the time remaining in the Animation at the given time in milliseconds.

Specified by:
getRemainingTime in interface AnimationJob
Parameters:
time - current time
Returns:
time remaining in the Animation at the given time in milliseconds

onPause

protected boolean onPause(long time)
Specified by:
onPause in class org.robokind.api.common.playable.AbstractPlayable

onResume

protected boolean onResume(long time)
Specified by:
onResume in class org.robokind.api.common.playable.AbstractPlayable

onStop

protected boolean onStop(long time)
Specified by:
onStop in class org.robokind.api.common.playable.AbstractPlayable

onComplete

protected boolean onComplete(long time)
Specified by:
onComplete in class org.robokind.api.common.playable.AbstractPlayable

setLoop

public void setLoop(boolean loop)
Description copied from interface: AnimationJob
If set true, the AnimationJob will loop, replaying after finishing.

Specified by:
setLoop in interface AnimationJob
Parameters:
loop - looping status

getLoop

public boolean getLoop()
Description copied from interface: AnimationJob
Returns the looping status of the AnimationJob.

Specified by:
getLoop in interface AnimationJob
Returns:
looping status of the AnimationJob


Copyright © 2011-2013. All Rights Reserved.