org.jscience.awt
Class DefaultGraph2DModel

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

public final class DefaultGraph2DModel
extends AbstractGraphModel
implements Graph2DModel, javax.swing.event.TableModelListener

The DefaultGraph2DModel class provides a default implementation of the Graph2DModel interface.


Nested Class Summary
static class DefaultGraph2DModel.DataSeries
          The DataSeries class encapsulates a data series for a graph.
 
Constructor Summary
DefaultGraph2DModel()
          Creates a new DefaultGraph2DModel object.
 
Method Summary
 void addSeries(DefaultGraph2DModel.DataSeries newSeries)
          Adds a data series.
 void addSeries(double[] newSeries)
          Adds a data series for the default x-axis values.
 void addSeries(float[] newSeries)
          Adds a data series for the default x-axis values.
 void addSeries(float[] newXAxis, double[] newSeries)
          Adds a data series.
 void addSeries(float[] newXAxis, float[] newSeries)
          Adds a data series.
 void changeSeries(int i, DefaultGraph2DModel.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!
 DefaultGraph2DModel.DataSeries getSeries(int i)
          DOCUMENT ME!
 float getXCoord(int i)
          DOCUMENT ME!
 float getYCoord(int i)
          DOCUMENT ME!
 boolean nextSeries()
          DOCUMENT ME!
 void removeSeries(int i)
          Remove a data series.
 int seriesLength()
          DOCUMENT ME!
 void setSeriesVisible(int i, boolean flag)
          Convenience method.
 void setXAxis(double[] x)
          Sets the default x-axis values.
 void setXAxis(float[] x)
          Sets the default x-axis values.
 void setXAxis(float a, float b, int n)
          Sets the default x-axis values.
 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.Graph2DModel
addGraphDataListener, removeGraphDataListener
 

Constructor Detail

DefaultGraph2DModel

public DefaultGraph2DModel()
Creates a new DefaultGraph2DModel object.

Method Detail

setXAxis

public void setXAxis(float[] x)
Sets the default x-axis values. A copy of the values is made.

Parameters:
x - DOCUMENT ME!

setXAxis

public void setXAxis(double[] x)
Sets the default x-axis values. A copy of the values is made.

Parameters:
x - DOCUMENT ME!

setXAxis

public void setXAxis(float a,
                     float b,
                     int n)
Sets the default x-axis values.

Parameters:
a - start of interval.
b - end of interval.
n - number of values.

addSeries

public void addSeries(float[] newSeries)
Adds a data series for the default x-axis values.

Parameters:
newSeries - DOCUMENT ME!

addSeries

public void addSeries(double[] newSeries)
Adds a data series for the default x-axis values.

Parameters:
newSeries - DOCUMENT ME!

addSeries

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

Parameters:
newSeries - DOCUMENT ME!

addSeries

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

Parameters:
newXAxis - DOCUMENT ME!
newSeries - DOCUMENT ME!

addSeries

public void addSeries(float[] newXAxis,
                      double[] newSeries)
Adds a data series. Convenience method.

Parameters:
newXAxis - DOCUMENT ME!
newSeries - DOCUMENT ME!

changeSeries

public void changeSeries(int i,
                         DefaultGraph2DModel.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 DefaultGraph2DModel.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!

getXCoord

public float getXCoord(int i)
DOCUMENT ME!

Specified by:
getXCoord in interface Graph2DModel
Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

getYCoord

public float getYCoord(int i)
DOCUMENT ME!

Specified by:
getYCoord in interface Graph2DModel
Parameters:
i - DOCUMENT ME!
Returns:
DOCUMENT ME!

seriesLength

public int seriesLength()
DOCUMENT ME!

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

firstSeries

public void firstSeries()
DOCUMENT ME!

Specified by:
firstSeries in interface Graph2DModel

nextSeries

public boolean nextSeries()
DOCUMENT ME!

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