com.ryanm.glvisualiser.imp
Class UniformEdge

java.lang.Object
  extended by com.ryanm.glvisualiser.GLEdge
      extended by com.ryanm.glvisualiser.imp.UniformEdge
All Implemented Interfaces:
Configurable, ValueListener
Direct Known Subclasses:
ArrowEdge, ConicalEdge

public abstract class UniformEdge
extends GLEdge
implements Configurable, ValueListener

The abstract superclass to use if your edge has a single material.

Author:
ryanm

Field Summary
 
Fields inherited from class com.ryanm.glvisualiser.GLEdge
dirty
 
Constructor Summary
UniformEdge(GLVisualiser drawable, GLMaterial material)
           
 
Method Summary
protected  void constructCompleteObject(javax.media.opengl.GLAutoDrawable drawable)
          This method should be overridden with calls that draw the edge, complete with GL state, colour and material manipulations
 Configurator getConfigurator()
          Gets a Configurator object that describes and can manipulate the variables of this Configurable.
 Configurator getConfigurator(java.lang.String name)
          Gets a configurator with the supplied name
 GLMaterial getMaterial()
          Gets the material that this object is rendered with
 void setMaterial(GLMaterial material)
          Sets the material for rendering this edge.
 void valueChanged(java.lang.String name)
          Is called by the configurator when a variable is changed
 
Methods inherited from class com.ryanm.glvisualiser.GLEdge
constructGeometry, drawGeometry, finalize, recompile, render
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniformEdge

public UniformEdge(GLVisualiser drawable,
                   GLMaterial material)
Parameters:
drawable -
material -
Method Detail

constructCompleteObject

protected void constructCompleteObject(javax.media.opengl.GLAutoDrawable drawable)
Description copied from class: GLEdge
This method should be overridden with calls that draw the edge, complete with GL state, colour and material manipulations

Specified by:
constructCompleteObject in class GLEdge
Parameters:
drawable - The GL/GLU context to use

setMaterial

public void setMaterial(GLMaterial material)
Sets the material for rendering this edge. This will recompile the display lists, so don't do it too often.

Parameters:
material - The new Material

getMaterial

public GLMaterial getMaterial()
Gets the material that this object is rendered with

Returns:
The current material

getConfigurator

public Configurator getConfigurator()
Description copied from interface: Configurable
Gets a Configurator object that describes and can manipulate the variables of this Configurable. This method must only return null if the Configurable object is Annotated such that an AnnotatedConfigurator can be built from it.

Specified by:
getConfigurator in interface Configurable
Returns:
A configurator object, or null if annotated

getConfigurator

public Configurator getConfigurator(java.lang.String name)
Gets a configurator with the supplied name

Parameters:
name - The name to give the configurator
Returns:
A configurator object

valueChanged

public void valueChanged(java.lang.String name)
Description copied from interface: ValueListener
Is called by the configurator when a variable is changed

Specified by:
valueChanged in interface ValueListener
Parameters:
name - The name of the variable