org.jscience.awt
Class DefaultCategoryGraph2DModel

java.lang.Object
  extended by org.jscience.awt.AbstractGraphModel
      extended by org.jscience.awt.DefaultCategoryGraph2DModel
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.TableModelListener, CategoryGraph2DModel

public final class DefaultCategoryGraph2DModel
extends AbstractGraphModel
implements CategoryGraph2DModel, javax.swing.event.TableModelListener

The DefaultCategoryGraph2DModel class provides a default implementation of the CategoryGraph2DModel interface.


Nested Class Summary
static class DefaultCategoryGraph2DModel.DataSeries
          The DataSeries class encapsulates a data series for a graph.
 
Constructor Summary
DefaultCategoryGraph2DModel()
          Creates a new DefaultCategoryGraph2DModel object.
 
Method Summary
 void addSeries(DefaultCategoryGraph2DModel.DataSeries newSeries)
          Adds a data series.
 void addSeries(double[] newSeries)
          Adds a data series of double values.
 void addSeries(float[] newSeries)
          Adds a data series of float values.
 void changeSeries(int i, DefaultCategoryGraph2DModel.DataSeries newSeries)
          Changes a data series.
 void changeSeries(int i, double[] newSeries)
          Changes a data series.
 void changeSeries(int i, float[] newSeries)
          Changes a data series.
 void firstSeries()
          DOCUMENT ME!
 java.lang.String getCategory(int i)
          DOCUMENT ME!
 DefaultCategoryGraph2DModel.DataSeries getSeries(int i)
          DOCUMENT ME!
 float getValue(int i)
          DOCUMENT ME!
 boolean nextSeries()
          DOCUMENT ME!
 void removeSeries(int i)
          Remove a data series.
 int seriesLength()
          DOCUMENT ME!
 void setCategories(java.lang.Object[] cat)
          Sets the x-axis values.
 void setSeriesVisible(int i, boolean flag)
          Convenience method.
 void tableChanged(javax.swing.event.TableModelEvent evt)
          Implementation of TabelModelListener.
 
Methods inherited from class org.jscience.awt.AbstractGraphModel
addGraphDataListener, fireGraphChanged, fireGraphDataChanged, fireGraphSeriesUpdated, removeGraphDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jscience.awt.CategoryGraph2DModel
addGraphDataListener, removeGraphDataListener
 

Constructor Detail

DefaultCategoryGraph2DModel

public DefaultCategoryGraph2DModel()
Creates a new DefaultCategoryGraph2DModel object.

Method Detail

setCategories

public void setCategories(java.lang.Object[] cat)
Sets the x-axis values. A copy of the values is made.

Parameters:
cat - DOCUMENT ME!

addSeries

public void addSeries(DefaultCategoryGraph2DModel.DataSeries newSeries)
Adds a data series.

Parameters:
newSeries - DOCUMENT ME!

addSeries

public void addSeries(float[] newSeries)
Adds a data series of float values. Convenience method.

Parameters:
newSeries - DOCUMENT ME!

addSeries

public void addSeries(double[] newSeries)
Adds a data series of double values. Convenience method.

Parameters:
newSeries - DOCUMENT ME!

changeSeries

public void changeSeries(int i,
                         DefaultCategoryGraph2DModel.DataSeries newSeries)
Changes a data series.

Parameters:
i - DOCUMENT ME!
newSeries - DOCUMENT ME!

changeSeries

public void changeSeries(int i,
                         float[] newSeries)
Changes a data series. Convenience method.

Parameters:
i - DOCUMENT ME!
newSeries - DOCUMENT ME!

changeSeries

public void changeSeries(int i,
                         double[] newSeries)
Changes a data series. Convenience method.

Parameters:
i - DOCUMENT ME!
newSeries - DOCUMENT ME!

removeSeries

public void removeSeries(int i)
Remove a data series.

Parameters:
i - DOCUMENT ME!

getSeries

public DefaultCategoryGraph2DModel.DataSeries getSeries(int i)
DOCUMENT ME!

Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

setSeriesVisible

public void setSeriesVisible(int i,
                             boolean flag)
Convenience method.

Parameters:
i - DOCUMENT ME!
flag - DOCUMENT ME!

tableChanged

public void tableChanged(javax.swing.event.TableModelEvent evt)
Implementation of TabelModelListener. Application code will not use this method explicitly, it is used internally.

Specified by:
tableChanged in interface javax.swing.event.TableModelListener
Parameters:
evt - DOCUMENT ME!

getCategory

public java.lang.String getCategory(int i)
DOCUMENT ME!

Specified by:
getCategory in interface CategoryGraph2DModel
Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

getValue

public float getValue(int i)
DOCUMENT ME!

Specified by:
getValue in interface CategoryGraph2DModel
Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

seriesLength

public int seriesLength()
DOCUMENT ME!

Specified by:
seriesLength in interface CategoryGraph2DModel
Returns:
DOCUMENT ME!

firstSeries

public void firstSeries()
DOCUMENT ME!

Specified by:
firstSeries in interface CategoryGraph2DModel

nextSeries

public boolean nextSeries()
DOCUMENT ME!

Specified by:
nextSeries in interface CategoryGraph2DModel
Returns:
DOCUMENT ME!