org.xith3d.loop.opscheduler.impl
Class BunchAnimatable

java.lang.Object
  extended by org.xith3d.loop.opscheduler.impl.BunchAnimatable
All Implemented Interfaces:
Animatable, ScheduledOperation, Updatable

public class BunchAnimatable
extends java.lang.Object
implements Animatable

This is an Animatable implementation, that animates a list of Animatables at once.


Constructor Summary
BunchAnimatable()
          Creates a new persistent BunchAnimatable.
BunchAnimatable(boolean persistent)
          Creates a new BunchAnimatable.
BunchAnimatable(boolean persistent, Animatable[] subAnims)
          Creates a new BunchAnimatable.
BunchAnimatable(boolean persistent, java.util.List<Animatable> subAnims)
          Creates a new BunchAnimatable.
 
Method Summary
 void addAnimatable(Animatable animatable)
          Adds an Animatable to the list of managed items.
 java.util.ArrayList<Animatable> getAnimatables()
           
 boolean isAlive()
          if false, the object will be removed from the scheduler next loop iteration
 boolean isAnimating()
          
 boolean isPersistent()
          If this operation is persistent, it remains scheduled after beeing executed once.
 boolean removeAnimatable(Animatable animatable)
          Removes an Animatable from the list of managed items.
 void setAlive(boolean alive)
          Sets this Object alive or dead
 void startAnimation(long gameTime, UpdatingThread.TimingMode timingMode)
          Starts the animation of this object.
 void stopAnimation()
          Stops the animation of this object.
 void update(long gameTime, long frameTime, UpdatingThread.TimingMode timingMode)
          Updates this Updatable object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BunchAnimatable

public BunchAnimatable(boolean persistent,
                       java.util.List<Animatable> subAnims)
Creates a new BunchAnimatable.

Parameters:
persistent - see isPersistent()
subAnims - the new list of sub-Animatables

BunchAnimatable

public BunchAnimatable(boolean persistent,
                       Animatable[] subAnims)
Creates a new BunchAnimatable.

Parameters:
persistent - see isPersistent()
subAnims - the new list of sub-Animatables

BunchAnimatable

public BunchAnimatable(boolean persistent)
Creates a new BunchAnimatable.

Parameters:
persistent - see isPersistent()

BunchAnimatable

public BunchAnimatable()
Creates a new persistent BunchAnimatable.

Method Detail

isPersistent

public boolean isPersistent()
If this operation is persistent, it remains scheduled after beeing executed once.

Specified by:
isPersistent in interface ScheduledOperation

setAlive

public void setAlive(boolean alive)
Sets this Object alive or dead

Specified by:
setAlive in interface ScheduledOperation
Parameters:
alive - if false, the object will be removed from the scheduler next loop iteration

isAlive

public boolean isAlive()
if false, the object will be removed from the scheduler next loop iteration

Specified by:
isAlive in interface ScheduledOperation

startAnimation

public void startAnimation(long gameTime,
                           UpdatingThread.TimingMode timingMode)
Starts the animation of this object.

Specified by:
startAnimation in interface Animatable

stopAnimation

public void stopAnimation()
Stops the animation of this object.

Specified by:
stopAnimation in interface Animatable

isAnimating

public boolean isAnimating()

Specified by:
isAnimating in interface Animatable
Returns:
is this object's animation running

addAnimatable

public final void addAnimatable(Animatable animatable)
Adds an Animatable to the list of managed items.

Parameters:
animatable -

removeAnimatable

public final boolean removeAnimatable(Animatable animatable)
Removes an Animatable from the list of managed items.

Parameters:
animatable -

getAnimatables

public final java.util.ArrayList<Animatable> getAnimatables()
Returns:
the list of managed items.

update

public void update(long gameTime,
                   long frameTime,
                   UpdatingThread.TimingMode timingMode)
Updates this Updatable object.

Specified by:
update in interface Updatable
Parameters:
gameTime - the gameTime in Milliseconds
frameTime - the frameTime in Milliseconds (needed time for the last frame)
timingMode - the TimingMode to use for frameTime.