nl.tudelft.goal.ut2004.visualizer.timeline.map
Class CollectionRenderer<T>

Package class diagram package CollectionRenderer
java.lang.Object
  extended by nl.tudelft.goal.ut2004.visualizer.timeline.map.CollectionRenderer<T>
Type Parameters:
T - Type of object subrenderers of this collection draws.
All Implemented Interfaces:
ISubGLRenderer<Collection<T>>

public class CollectionRenderer<T>
extends Object
implements ISubGLRenderer<Collection<T>>

Basically list of ISubGLRenderers with stuff for manipulating it and rendering it. Holds order of subrenderers.

Author:
Honza

Constructor Summary
CollectionRenderer()
           
 
Method Summary
 void addRenderer(ISubGLRenderer<? extends T> subrenderer)
          Add renderer to collection.
 void destroy()
          Call renderer to clean up any resources it used.
 Set<T> getDrawnObjects()
          Get set of all objects this collection draws.
 int getGLName()
           
 Collection<T> getObject()
          Return object this renderer draws.
 T getObjectsByGLName(int glName)
           
 Collection<T> getObjectsByGLName(int[] list)
           
 void prepare(javax.media.opengl.GL gl)
          Prepare all renderers for rendering
 boolean removeRenderer(ISubGLRenderer<? extends T> subrenderer)
          Remove subrenderer from collection
 void removeRenderersOf(Object o)
          Remove all renderers that draw object o.
 void render(javax.media.opengl.GL gl)
          Display stuff you want to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionRenderer

public CollectionRenderer()
Method Detail

addRenderer

public void addRenderer(ISubGLRenderer<? extends T> subrenderer)
Add renderer to collection. It will be rendered after all previous renders are drawn.

Parameters:
subrenderer -

removeRenderer

public boolean removeRenderer(ISubGLRenderer<? extends T> subrenderer)
Remove subrenderer from collection

Parameters:
subrenderer - renderer to be removed
Returns:
true if subrenderes was in collection

removeRenderersOf

public void removeRenderersOf(Object o)
Remove all renderers that draw object o.

Parameters:
o - object that may have renderers in collection we want to remove

getDrawnObjects

public Set<T> getDrawnObjects()
Get set of all objects this collection draws.

Returns:
all objects this collection draws

render

public void render(javax.media.opengl.GL gl)
Description copied from interface: ISubGLRenderer
Display stuff you want to. Assume that settings have already been set in CollectionRenderer

Specified by:
render in interface ISubGLRenderer<Collection<T>>

getObject

public Collection<T> getObject()
Description copied from interface: ISubGLRenderer
Return object this renderer draws. Because objects we want to draw can change rapidly, we have to remove and add subrenderers based on passed objects (renderer R draws object A, now we don't want to draw A anymore, we have to go through subrenderers to find which ones draws it).

Specified by:
getObject in interface ISubGLRenderer<Collection<T>>
Returns:
Object this renderer draws.

prepare

public void prepare(javax.media.opengl.GL gl)
Prepare all renderers for rendering

Specified by:
prepare in interface ISubGLRenderer<Collection<T>>
Parameters:
gl -

getObjectsByGLName

public T getObjectsByGLName(int glName)

getObjectsByGLName

public Collection<T> getObjectsByGLName(int[] list)

destroy

public void destroy()
Description copied from interface: ISubGLRenderer
Call renderer to clean up any resources it used.

Specified by:
destroy in interface ISubGLRenderer<Collection<T>>

getGLName

public int getGLName()
Specified by:
getGLName in interface ISubGLRenderer<Collection<T>>


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.