jAER project on SourceForge

net.sf.jaer.util.chart
Class Series

java.lang.Object
  extended by net.sf.jaer.util.chart.Series
Direct Known Subclasses:
VectorSeries

public class Series
extends java.lang.Object

The Series class. A Series is a data series in a chart; its view is a Category object. The data are cached and then transferred to an OpenGL device.


Field Summary
protected  java.nio.FloatBuffer cache
          A buffer to cache new data points before they are transfered to the OpenGL device - if buffer extension available.
protected  int capacity
          The max number of data points in the series.
protected static int DEFAULT_CAPACITY
          Default capacity of series
protected  int dimension
          The dimension of the elements (=vertices)
protected  int elementsCount
          number of flushed elements (= dimension * verticesCount)
protected  int elementSize
          number of bytes per element
protected  javax.media.opengl.GL gl
          The interface to opengl
protected  java.nio.FloatBuffer vertices
          Local buffer that holds charted points in case buffer extension not available.
 
Constructor Summary
Series(int dimensions)
          Create a new Series object with default capacity.
Series(int dimensions, int capacity)
          Create a new Series object with capacity.
 
Method Summary
 void add(float x, float y)
          Add a data item to the series cache.
 void add(float x, float y, float z)
          Add a data item to the series cache.
 void clear()
          Clears points.
 void draw(javax.media.opengl.GL gl, int method)
          Flushes data to opengl graphics device and draws the vertices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CAPACITY

protected static final int DEFAULT_CAPACITY
Default capacity of series

See Also:
Constant Field Values

dimension

protected int dimension
The dimension of the elements (=vertices)


capacity

protected int capacity
The max number of data points in the series.


elementSize

protected final int elementSize
number of bytes per element


elementsCount

protected int elementsCount
number of flushed elements (= dimension * verticesCount)


cache

protected java.nio.FloatBuffer cache
A buffer to cache new data points before they are transfered to the OpenGL device - if buffer extension available.


vertices

protected java.nio.FloatBuffer vertices
Local buffer that holds charted points in case buffer extension not available.


gl

protected javax.media.opengl.GL gl
The interface to opengl

Constructor Detail

Series

public Series(int dimensions,
              int capacity)
Create a new Series object with capacity.

Parameters:
dimensions - the number of dimensions (2 or 3)
capacity - max number of points

Series

public Series(int dimensions)
Create a new Series object with default capacity.

Parameters:
dimensions - the number of dimensions (2 or 3)
Method Detail

add

public void add(float x,
                float y)
Add a data item to the series cache.

Parameters:
x - the x value
y - the y value

add

public void add(float x,
                float y,
                float z)
Add a data item to the series cache.


clear

public void clear()
Clears points.


draw

public void draw(javax.media.opengl.GL gl,
                 int method)
Flushes data to opengl graphics device and draws the vertices. The gl object must be always the same.

Parameters:
gl - the OpenGL context (must be identical betweeen calls)
method - the method of drawing the series line segments, e.g. GL.GL_LINE_STRIP.

jAER project on SourceForge