com.speckled.specksim.gui.visualiser
Interface StateRenderer

All Superinterfaces:
java.lang.Comparable<StateRenderer>, Configurable
All Known Implementing Classes:
AbstractStateRenderer, BodyRenderer, BroadcastRenderer, EpidemicRenderer, GravityRenderer, NeighbourhoodRenderer, SpeckRenderer, StatsPlotter, VelocityRenderer, WallRenderer

public interface StateRenderer
extends Configurable, java.lang.Comparable<StateRenderer>

This interface should be implemented to add visualisation capabilities to the simulator. All renderers must be registered using SpeckVisualiser.loadRenderer(String) before the visualiser is constructed.

Author:
ryanm

Method Summary
 void constructGLObjects(javax.media.opengl.GLAutoDrawable drawable)
          GLObjects used by the renderer should be built here
 java.lang.String getName()
          Gets the name of this renderer
 int getRenderPriority()
          Gets a priority indicator for this renderer.
 void init(SpeckVisualiser visualiser)
          Called when the renderers are constructed.
 boolean isEnabled()
          Determnes whether this renderer is enabled or not
 void render(javax.media.opengl.GLAutoDrawable drawable, StateSink state)
          Rendering should be perfromed here
 void setEnabled(boolean b)
          Called to enable or disable the renderer.
 void update()
          Any frame-by-frame animation should be done here
 
Methods inherited from interface com.ryanm.config.Configurable
getConfigurator
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getName

java.lang.String getName()
Gets the name of this renderer

Returns:
A name string

init

void init(SpeckVisualiser visualiser)
Called when the renderers are constructed. Renderers who are interested in knowing the nameStack of what is under the mouse should save a reference to the visualiser and use it to call getNameStackUnderMouse()

Parameters:
visualiser - The parent visualiser that this renderer belongs to

constructGLObjects

void constructGLObjects(javax.media.opengl.GLAutoDrawable drawable)
GLObjects used by the renderer should be built here

Parameters:
drawable - The context to use when building

setEnabled

void setEnabled(boolean b)
Called to enable or disable the renderer.

Parameters:
b -

isEnabled

boolean isEnabled()
Determnes whether this renderer is enabled or not

Returns:
true if enabled, false otherwise

update

void update()
Any frame-by-frame animation should be done here


render

void render(javax.media.opengl.GLAutoDrawable drawable,
            StateSink state)
Rendering should be perfromed here

Parameters:
drawable - The context on which to draw
state - The state to draw

getRenderPriority

int getRenderPriority()
Gets a priority indicator for this renderer. Renderers with higher priorities will execute before those with lower priorities

Returns:
An int priority indicator