org.jrabbit.standard.profiler.renderer
Class ProfilerRenderer

java.lang.Object
  extended by org.jrabbit.standard.profiler.renderer.ProfilerRenderer
Direct Known Subclasses:
BLProfilerRenderer, BRProfilerRenderer, TLProfilerRenderer, TRProfilerRenderer

public abstract class ProfilerRenderer
extends java.lang.Object

A ProfilerRenderer is used by a ProfilerDisplay to render its ProfilerEntities. Essentially, though a ProfilerDisplay manages the LIST of entities it shows, it delegates their ORGANIZATION to its renderer. That it the sole purpose of this class - to provide a lightweight means of custom organization.

Author:
Chris Molini

Field Summary
protected  float padding
          The space to put between each rendered ProfilerEntity.
 
Constructor Summary
ProfilerRenderer(float padding)
          Creates a ProfilerRenderer that spaces the ProfilerEntities the indicated distance apart.
 
Method Summary
 float padding()
          Learns the current padding being used.
abstract  void render(java.lang.Iterable<ProfilerEntity> entities, float width, float height, Color color)
          Renders the supplied list of ProfilerEntities, rendering each at the indicated Color.
 void setPadding(float padding)
          Redefines the current padding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

padding

protected float padding
The space to put between each rendered ProfilerEntity.

Constructor Detail

ProfilerRenderer

public ProfilerRenderer(float padding)
Creates a ProfilerRenderer that spaces the ProfilerEntities the indicated distance apart.

Parameters:
padding - The distance to put between each ProfilerEntity.
Method Detail

padding

public float padding()
Learns the current padding being used.

Returns:
The space between each ProfilerEntity when rendered.

setPadding

public void setPadding(float padding)
Redefines the current padding.

Parameters:
padding. - The space to put between each ProfilerEntity when rendered.

render

public abstract void render(java.lang.Iterable<ProfilerEntity> entities,
                            float width,
                            float height,
                            Color color)
Renders the supplied list of ProfilerEntities, rendering each at the indicated Color. NOTE: The ProfilerRenderer should do its best to keep all rendering within the indicated dimensions. NOTE #2: At the beginning of rendering, the OpenGL Modelview Matrix is already set to the top-left corner of the indicated rectangle. This should be respected.

Parameters:
entities - The ordered list of ProfilerEntities to render.
width - The width of the area to keep rendering within.
height - The height of the area to keep rendering within.
color - The Color to render each ProfilerEntity at.