JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d.data
Class Base3dGridDataSource

java.lang.Object
  |
  +--com.klg.jclass.chart3d.event.Chart3dDataSupport
        |
        +--com.klg.jclass.chart3d.data.Base3dDataSource
              |
              +--com.klg.jclass.chart3d.data.Base3dGridDataSource
All Implemented Interfaces:
Chart3dDataManager, Chart3dDataModel, Chart3dGridDataModel, Cloneable, HoleValueChart3dDataModel, LabelledChart3dDataModel, LabelledChart3dGridDataModel, Serializable
Direct Known Subclasses:
JCDefault3dGridDataSource

public class Base3dGridDataSource
extends Base3dDataSource
implements Chart3dGridDataModel, LabelledChart3dGridDataModel, Cloneable, Serializable

This class is the base for any data source that chooses to store data internally using gridmodel arrays.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.util.JCListenerList chartDataListeners
          List of interested listeners.
protected  String dataSourceName
          Name of this datasource.
protected  double[] xGrid
          Array of doubles for X values (columns).
protected  String[] xLabels
          The X axis labels.
protected  double[] yGrid
          Array of doubles for Y values (rows).
protected  String[] yLabels
          The Y axis labels.
protected  double[][] zValues
          Two-dimensional array of doubles for Z values (data).
 
Fields inherited from class com.klg.jclass.chart3d.data.Base3dDataSource
holeValue
 
Fields inherited from class com.klg.jclass.chart3d.event.Chart3dDataSupport
source
 
Fields inherited from interface com.klg.jclass.chart3d.HoleValueChart3dDataModel
DEFAULT_HOLE_VALUE
 
Constructor Summary
Base3dGridDataSource(String name, double[] xGrid, double[] yGrid, double[][] zValues)
          Constructor for creating a new Base3dGridDataSource when the data is already known, includes a String for the name .
 
Method Summary
 Object clone()
          Overrides clone in class Object.
 String getDataSourceName()
          Returns the datasource name property .
 int getNumX()
          Retrieves the number of X grid values (which is the same as the number of z arrays) this datasource holds.
 int getNumY()
          Retrieves the number of Y grid values.
 double[] getXGrid()
          Returns the xGrid values If the values don't exist, but the zValues do, a default array of values with an increment of 1.0 will be generated.
 String[] getXLabels()
          Retrieves the xLabels .
 double[] getYGrid()
          Returns the yGrid values.
 String[] getYLabels()
          Retrieves the yLabels
 double[][] getZValues()
          Returns the ZValues (data).
 void setDataSourceName(String name)
          Sets the datasource name property .
 void setXGrid(double[] xGrid)
          Sets the xGrid values .
 void setXLabels(String[] xLabels)
          Sets the xLabels .
 void setYGrid(double[] yGrid)
          Sets the yGrid values .
 void setYLabels(String[] yLabels)
          Sets the yLabels.
 void setZValues(double[][] zValues)
          Sets the ZValues (data).
 
Methods inherited from class com.klg.jclass.chart3d.data.Base3dDataSource
getHoleValue, setHoleValue
 
Methods inherited from class com.klg.jclass.chart3d.event.Chart3dDataSupport
addChart3dDataListener, fireChart3dDataEvent, fireChart3dDataEvent, removeChart3dDataListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xGrid

protected double[] xGrid
Array of doubles for X values (columns).


yGrid

protected double[] yGrid
Array of doubles for Y values (rows).


zValues

protected double[][] zValues
Two-dimensional array of doubles for Z values (data).


dataSourceName

protected String dataSourceName
Name of this datasource.


chartDataListeners

protected com.klg.jclass.util.JCListenerList chartDataListeners
List of interested listeners.


xLabels

protected String[] xLabels
The X axis labels.


yLabels

protected String[] yLabels
The Y axis labels.

Constructor Detail

Base3dGridDataSource

public Base3dGridDataSource(String name,
                            double[] xGrid,
                            double[] yGrid,
                            double[][] zValues)
Constructor for creating a new Base3dGridDataSource when the data is already known, includes a String for the name .

Parameters:
name - Name String of this datasource (optional, can be null)
xGrid - Array of doubles for X values (columns)
yGrid - Array of doubles for Y values (rows)
zValues - Two-dimensional array of doubles for Z values (data)
Method Detail

setDataSourceName

public void setDataSourceName(String name)
Sets the datasource name property .

Parameters:
name - String name of this datasource

getDataSourceName

public String getDataSourceName()
Returns the datasource name property .

Specified by:
getDataSourceName in interface LabelledChart3dDataModel
Returns:
name String name of this datsource

setXGrid

public void setXGrid(double[] xGrid)
Sets the xGrid values .

Parameters:
xGrid - Array of doubles

getXGrid

public double[] getXGrid()
Returns the xGrid values If the values don't exist, but the zValues do, a default array of values with an increment of 1.0 will be generated. If neither the zValues, nor xGrid has been set, this method will return null.

Specified by:
getXGrid in interface Chart3dGridDataModel
Returns:
xGrid Array of doubles

setYGrid

public void setYGrid(double[] yGrid)
Sets the yGrid values .

Parameters:
yGrid - Array of doubles

getYGrid

public double[] getYGrid()
Returns the yGrid values. If the values don't exist, but the zValues do, a default array of values with an increment of 1.0 will be generated. If neither the zValues, nor yGrid has been set, this method will return null.

Specified by:
getYGrid in interface Chart3dGridDataModel
Returns:
yGrid Array of doubles

setZValues

public void setZValues(double[][] zValues)
Sets the ZValues (data).

Parameters:
zValues - Two-dimensional array of doubles

getZValues

public double[][] getZValues()
Returns the ZValues (data).

Specified by:
getZValues in interface Chart3dGridDataModel
Returns:
zValues Two-dimensional array of doubles

getNumX

public int getNumX()
Retrieves the number of X grid values (which is the same as the number of z arrays) this datasource holds.

Specified by:
getNumX in interface LabelledChart3dGridDataModel
Returns:
The number of X grid values (or z value arrays).

getNumY

public int getNumY()
Retrieves the number of Y grid values. This is the minimum length of all the z value arrays.

Specified by:
getNumY in interface LabelledChart3dGridDataModel
Returns:
The number of Y grid values

getXLabels

public String[] getXLabels()
Retrieves the xLabels .

Specified by:
getXLabels in interface LabelledChart3dGridDataModel
Returns:
xLabels a String array containing the x labels

setXLabels

public void setXLabels(String[] xLabels)
Sets the xLabels .

Parameters:
xLabels - a String array

getYLabels

public String[] getYLabels()
Retrieves the yLabels

Specified by:
getYLabels in interface LabelledChart3dGridDataModel
Returns:
yLabels a String array containing the y labels

setYLabels

public void setYLabels(String[] yLabels)
Sets the yLabels.

Parameters:
yLabels - a String array

clone

public Object clone()
Overrides clone in class Object. This clone method retuns a deep copy of all Base3dGridDataSource fields, except for the JCListenerList, which is set to null. Overrides @see Object#clone().

Overrides:
clone in class Object
Returns:
a clone of this instance.
Throws:
OutOfMemoryError - - if there is not enough memory.

Copyright © 2004 Quest Software Inc..
All rights reserved.