org.odejava.display
Class DisplayBin

java.lang.Object
  extended by org.odejava.display.DisplayBin

public class DisplayBin
extends Object

Stores a List of BoundDisplayObjectS. The DisplayBin is used by applications to sync the transforms of their DisplayObjects with their ODE counterparts.

For example, in Xith3D, one would link the TransformGroup which represents a box object to an ODE box geometry object that is attached to a body. By calling updateAll() on this class, the Xith3D representation of the box will be updated to mirror that of the ODE representation bringing the simulation to life.

Author:
William Denniss

Constructor Summary
DisplayBin()
          Creates a DisplayBin with the default list type
DisplayBin(List<BoundDisplayObject> listType)
          Creates a DisplayBin with a new instance of the passed List class.
 
Method Summary
 void add(BoundDisplayObject toAdd)
          Adds a BoundDisplayObject.
 void add(DisplayBin toAdd)
          Adds all BoundDisplayObjects from the given DisplayBin into this one
 Iterator<BoundDisplayObject> iterator()
          Returns an Iterator of the list of BoundDisplayObjectS
 ListIterator<BoundDisplayObject> listIterator()
          Returns a ListIterator of the list of BoundDisplayObjectS
 void remove(BoundDisplayObject toRemove)
          Removes a BoundDisplayObject.
 void remove(DisplayBin toRemove)
          Removes all BoundDisplayObjects from the given DisplayBin into this one
 void updateAll()
          Calls update on all contained BoundDisplayObjectS
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayBin

public DisplayBin()
Creates a DisplayBin with the default list type


DisplayBin

public DisplayBin(List<BoundDisplayObject> listType)
Creates a DisplayBin with a new instance of the passed List class.

Parameters:
listType - The List whose class will be used to contain the BoundDisplayObjectS
Method Detail

add

public void add(BoundDisplayObject toAdd)
Adds a BoundDisplayObject.

Parameters:
toAdd - the BoundDisplayObject to add.

remove

public void remove(BoundDisplayObject toRemove)
Removes a BoundDisplayObject.

Parameters:
toRemove - the BoundDisplayObject to remove.

add

public void add(DisplayBin toAdd)
Adds all BoundDisplayObjects from the given DisplayBin into this one

Parameters:
toAdd - the DisplayBin whose objects will be added

remove

public void remove(DisplayBin toRemove)
Removes all BoundDisplayObjects from the given DisplayBin into this one

Parameters:
toRemove - the DisplayBin whose objects will be removed

iterator

public Iterator<BoundDisplayObject> iterator()
Returns an Iterator of the list of BoundDisplayObjectS

Returns:
an Iterator of the list of BoundDisplayObjectS

listIterator

public ListIterator<BoundDisplayObject> listIterator()
Returns a ListIterator of the list of BoundDisplayObjectS

Returns:
a ListIterator of the list of BoundDisplayObjectS

updateAll

public void updateAll()
Calls update on all contained BoundDisplayObjectS