com.ryanm.glvisualiser.imp
Class DataPlotter

java.lang.Object
  extended by com.ryanm.glvisualiser.imp.DataPlotter
All Implemented Interfaces:
Configurable

public class DataPlotter
extends java.lang.Object
implements Configurable

Provides a visualisation of a dataset

Author:
ryanm

Constructor Summary
DataPlotter(javax.media.opengl.GLAutoDrawable drawable, java.awt.Color colour, float width)
           
 
Method Summary
 void clearData()
          Clears this plotter's data
 Configurator getConfigurator()
          Gets a Configurator object that describes and can manipulate the variables of this Configurable.
 float getMaxLineWidth()
          Gets the maximum line width possible with this OpenGL implementation
 boolean isPickable()
          Determines if this dataplotter is pickable or not
 void render(javax.media.opengl.GLAutoDrawable drawable)
          Renders the currently dataset
 void setAdaptive(boolean b)
          Sets if the plotter will adapt to the data's value range
 void setColour(java.awt.Color colour)
          Sets the colour of this dataplotter
 void setData(float[] data)
          Sets the data array to visualise
 void setData(float[][] data)
          Sets the data array to visualise
 void setLabel(java.lang.String label)
          Sets the label.
 void setOffset(float f)
          Sets the offset for this plotter.
 void setPickable(boolean b)
          Sets the pickable status of this dataplotter.
 void setValueRange(float[] range)
          Sets the min and max values of this data plotter.
 void setWidth(float width)
          Sets the width of the lines of the plot
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataPlotter

public DataPlotter(javax.media.opengl.GLAutoDrawable drawable,
                   java.awt.Color colour,
                   float width)
Parameters:
drawable -
colour -
width -
Method Detail

setOffset

public void setOffset(float f)
Sets the offset for this plotter. The min, max and name labels will be trasnalted by this amount on the y-axis

Parameters:
f - The offset distance

setLabel

public void setLabel(java.lang.String label)
Sets the label. This will be rendered halfway between the mina nd max values

Parameters:
label -

setColour

public void setColour(java.awt.Color colour)
Sets the colour of this dataplotter

Parameters:
colour - The new colour

setWidth

public void setWidth(float width)
Sets the width of the lines of the plot

Parameters:
width - The desired width

setData

public void setData(float[] data)
Sets the data array to visualise

Parameters:
data - The data array

setData

public void setData(float[][] data)
Sets the data array to visualise

Parameters:
data - The data array

clearData

public void clearData()
Clears this plotter's data


setAdaptive

public void setAdaptive(boolean b)
Sets if the plotter will adapt to the data's value range

Parameters:
b - true to adapt, false to use the set value range

setValueRange

public void setValueRange(float[] range)
Sets the min and max values of this data plotter.

Parameters:
range - A float array of at least two elements, with range[ 0 ] = min, range[ 1 ] = max

getMaxLineWidth

public float getMaxLineWidth()
Gets the maximum line width possible with this OpenGL implementation

Returns:
the maiximum possible line width

setPickable

public void setPickable(boolean b)
Sets the pickable status of this dataplotter. When pickable, the namestack will contain the index or indices of the data point that lies under the mouse

Parameters:
b - true to enable picking, false otherwise

isPickable

public boolean isPickable()
Determines if this dataplotter is pickable or not

Returns:
true if the plot is pickable, false otherwise

render

public void render(javax.media.opengl.GLAutoDrawable drawable)
Renders the currently dataset

Parameters:
drawable - The GL context to render to

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