org.jrabbit.base.graphics.layers.types
Class DefaultLayer

java.lang.Object
  extended by org.jrabbit.base.data.structures.LockingList<Renderable>
      extended by org.jrabbit.base.graphics.layers.types.DefaultLayer
All Implemented Interfaces:
java.lang.Iterable<Renderable>, Renderable, Referenced, Accepter<Renderable>, Container<Renderable>, Remover<Renderable>, Layer, GLTransform, GLGroupTransformed
Direct Known Subclasses:
BlendedLayer

public class DefaultLayer
extends LockingList<Renderable>
implements Layer

DefaultLayer adds Layer functionality to LockingList. This way, all adding, removal, and iteration processes are very fast, concurrent-safe, and allow only unique objects.

Author:
Chris Molini

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jrabbit.base.data.structures.LockingList
LockingList.UList
 
Field Summary
protected  java.lang.String reference
          The identifier of this Layer.
protected  GLGroupTransform transforms
          The list of transforms that affect this Layer.
 
Fields inherited from class org.jrabbit.base.data.structures.LockingList
addCache, adding, clear, main, removalCache, removing
 
Constructor Summary
DefaultLayer(java.lang.String reference)
          Creates a DefaultLayer with the specified identifier.
 
Method Summary
 void bind()
          Applies the GLGroupTransform to adjust OpenGL settings.
 java.lang.String reference()
          Gets the reference associated with this object.
 void release()
          Releases all changes in the GLGroupTransform.
 void render()
          Applies the GLGroupTransform, renders every object contained by this Layer, and then releases the GLGroupTransform.
 GLGroupTransform transforms()
          Accesses the list of transforms.
 
Methods inherited from class org.jrabbit.base.data.structures.LockingList
add, add, add, clear, contains, isEmpty, iterator, lock, locked, predictedSize, remove, remove, remove, size, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
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
 

Field Detail

reference

protected java.lang.String reference
The identifier of this Layer.


transforms

protected GLGroupTransform transforms
The list of transforms that affect this Layer. By default, this is empty.

Constructor Detail

DefaultLayer

public DefaultLayer(java.lang.String reference)
Creates a DefaultLayer with the specified identifier.

Parameters:
reference - The String that will identify this Layer.
Method Detail

reference

public java.lang.String reference()
Gets the reference associated with this object.

Specified by:
reference in interface Referenced
Returns:
The String that identifies the object.

transforms

public GLGroupTransform transforms()
Accesses the list of transforms.

Specified by:
transforms in interface GLGroupTransformed
Returns:
The GLGroupTransform that dynamically controls OpenGL's state.

bind

public void bind()
Applies the GLGroupTransform to adjust OpenGL settings.

Specified by:
bind in interface GLTransform

release

public void release()
Releases all changes in the GLGroupTransform.

Specified by:
release in interface GLTransform

render

public void render()
Applies the GLGroupTransform, renders every object contained by this Layer, and then releases the GLGroupTransform.

Specified by:
render in interface Renderable