org.jrabbit.base.graphics.layers.grouped
Interface LayeredRenderList

All Superinterfaces:
Accepter<Layer>, Container<Layer>, Factory<Layer>, java.lang.Iterable<Layer>, KeyedContainer<Layer>, Remover<Layer>, Renderable
All Known Implementing Classes:
DefaultLayeredRenderList

public interface LayeredRenderList
extends Renderable, KeyedContainer<Layer>

A LayeredRenderList is a data structure designed to use Layers to manage and render groups of Renderable objects. The most important functionality of the class is to manage and render a dynamic list of Layers. The list remembers order of addition, and renders the Layers in that order. In this list, Layers are keyed to their references, and no two layers can have the same reference. This functionality is inherited from the KeyedContainer and Renderable interfaces. Secondly, a LayeredRenderList provides methods to place Renderable objects in the desired Layer. There are methods to add and remove, either with a String pointing to the desired Layer to affect or without (in which case the LayeredRenderList does the best it can to accommodate the operation).

Author:
Chris Molini

Method Summary
 boolean add(Renderable renderable)
          Adds a Renderable to a Layer within the list.
 boolean add(Renderable renderable, java.lang.String reference)
          Adds the indicated Renderable to the referenced Layer.
 Layer containing(Renderable renderable)
          Finds and retrieves the Layer that contains the indicated Renderable.
 boolean remove(Renderable renderable)
          Attempts to remove the indicated Renderable object from the list of Layers.
 boolean remove(Renderable renderable, java.lang.String reference)
          Attempts to remove the indicated Renderable object from the referenced Layer.
 
Methods inherited from interface org.jrabbit.base.core.types.Renderable
render
 
Methods inherited from interface org.jrabbit.base.data.structures.base.KeyedContainer
add, add, contains, get, remove, remove
 
Methods inherited from interface org.jrabbit.base.data.structures.base.Container
clear, contains, size
 
Methods inherited from interface org.jrabbit.base.data.structures.base.Accepter
add, add
 
Methods inherited from interface org.jrabbit.base.data.structures.base.Remover
remove, remove
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.jrabbit.base.data.Factory
create
 

Method Detail

add

boolean add(Renderable renderable,
            java.lang.String reference)
Adds the indicated Renderable to the referenced Layer. If the indicated Layer is not in the list, no add takes place.

Parameters:
renderable - The Renderable object to add to the Layer.
reference - The reference that identifies the target Layer in the list.
Returns:
True if the add succeeded, false if not.

add

boolean add(Renderable renderable)
Adds a Renderable to a Layer within the list. Which layer this is may vary by implementation - it probably makes most sense to add this to the "top" layer, but other methods may make sense depending on the application.

Parameters:
renderable - The Renderable object to add.
Returns:
True if the add succeeded, false if not.

remove

boolean remove(Renderable renderable,
               java.lang.String reference)
Attempts to remove the indicated Renderable object from the referenced Layer. NOTE: If the renderable is in one of the Layers but not the one referenced, this method makes no attempt to search through other Layers - it simply returns false.

Parameters:
renderable - The Renderable object to remove from the Layer.
reference - The reference that identifies the target Layer in the list.
Returns:
True if the removal succeeded, false if not.

remove

boolean remove(Renderable renderable)
Attempts to remove the indicated Renderable object from the list of Layers. This method should search through all Layers in an attempt to find the Layere to remove from.

Parameters:
renderable - The Renderable object to remove.
Returns:
True if the removal succeeded, false if not.

containing

Layer containing(Renderable renderable)
Finds and retrieves the Layer that contains the indicated Renderable.

Parameters:
renderable - The Renderable object to search for.
Returns:
The Layer that contains the object; or if none do, null.