JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class Chart3dGridData

java.lang.Object
  |
  +--com.klg.jclass.chart3d.TrackChange
        |
        +--com.klg.jclass.chart3d.Chart3dData
              |
              +--com.klg.jclass.chart3d.Chart3dGridData
All Implemented Interfaces:
Changeable, Changeable, Serializable

public class Chart3dGridData
extends Chart3dData

Stores information that represents a grid of points. The user sets information on this object by setting the grid data model attribute of the parent Chart3dDataView object. The user can then retrieve information via this object.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.chart3d.JCChart3dStyle chartStyle
          The chartStyle used if the chart type is a scatter plot.
protected  com.klg.jclass.chart3d.GridLimits gridLimits
           
protected  double minXStep
           
protected  double minYStep
           
protected  int numX
          The number of X grid values used.
protected  int numY
          The number of Y grid values used
protected  double[] xGrid
          The array of X grid values.
protected  String[] xLabels
          The X data labels for this gridData object.
protected  ArrayList xLabelsArrayList
          The X data labels for this gridData object in an array list.
protected  double[] yGrid
          The array of Y grid values.
protected  String[] yLabels
          The Y data labels for this gridData object.
protected  ArrayList yLabelsArrayList
          The Y data labels for this gridData object in an array list.
protected  double[][] zValues
          The grid of Z values.
 
Fields inherited from class com.klg.jclass.chart3d.Chart3dData
dataHandler, dataMax, dataMin, dataOK, dataSource, dataView, holeValue, name, screenPoints
 
Fields inherited from class com.klg.jclass.chart3d.TrackChange
changed, changedFlag
 
Fields inherited from interface com.klg.jclass.chart3d.Changeable
ALL, CONTOURS, NOTIFY_CA_RECALC, NOTIFY_CA_REDRAW, NOTIFY_LEGEND_RECALC, NOTIFY_LEGEND_REDRAW
 
Fields inherited from interface com.klg.jclass.util.Changeable
BASIC_CHANGE_MASK, LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW
 
Constructor Summary
Chart3dGridData()
          Basic constructor.
Chart3dGridData(com.klg.jclass.chart3d.Chart3dDataView dataView, com.klg.jclass.chart3d.Chart3dGridDataModel data)
          Internal constructor specifying parent data view and arrays holding data.
 
Method Summary
protected  void calcAnnoLimits()
          Makes a first rough pass at the annotation limits, extending the axis limits out to include the origin and making sure that bars fit within the axis.
protected  void calcLimits(com.klg.jclass.chart3d.Chart3dGridData zoneData)
          Calculates and sets the axis limits, grid limits, and the contour limits.
protected  void computeZLimits(com.klg.jclass.chart3d.Chart3dGridData data, double oldMin, double oldMax)
          Computes the Z min and max data values and store these in dataMin and dataMax.
 com.klg.jclass.chart3d.JCChart3dStyle getChartStyle()
          Gets the chart style for this grid data object.
 int getGridIndex(double t, boolean isXArray, boolean transform)
          Returns the largest x or y grid index that the value 't' is greater than.
 com.klg.jclass.chart3d.GridLimits getGridLimits()
          Returns the current GridLimits object.
 double getMinXStep()
          Retrieves the minimum difference between x grid values.
 double getMinYStep()
          Retrieves the minimum difference between y grid values.
 int getNumX()
          This is the number of X points that is actually used (this may not match xGrid.length)
 int getNumY()
          This is the number of Y points that is actually used (this may not match yGrid.length)
 double getX(int i)
          Returns the X value at the specified index.
 int getXClosest(double x)
          Returns the index that contains the x value closest to the specified value.
 double[] getXGrid()
          Returns the X grid array.
 String[] getXLabels()
          Returns the X data labels for this Chart3dGridData object
 ArrayList getXLabelsArrayList()
          Get the X data labels for this Chart3dGridData object in an array list.
 double getY(int i)
          Returns the Y value at the specified index.
 int getYClosest(double y)
          Returns the index that contains the y value closest to the specified value.
 double[] getYGrid()
          Returns the Y grid array.
 String[] getYLabels()
          Returns the Y data labels.
 ArrayList getYLabelsArrayList()
          Get the Y data labels for this Chart3dGridData object in an array list.
 double getZValue(int x, int y)
          Returns the data value (or z value) that corresponds to grid point (x, y).
 double[][] getZValues()
          Returns the entire zValues array.
protected  boolean matchData(com.klg.jclass.chart3d.Chart3dGridData data)
          Checks to see if the grid from the passed in data matches the grid from this data.
 void precomputePoints()
          Precomputes the screen points for each of the grid values
protected  void processData()
          Calculates the data array lengths that can be used and value of dataOK.
protected  void setAllXYZValues(double[] xGrid, double[] yGrid, double[][] zValues)
          Sets the X grid, Y grid, and Z values arrays.
 void setChartStyle(com.klg.jclass.chart3d.JCChart3dStyle chartStyle)
          Sets the chart style for this grid data object.
protected  void setDataSource(com.klg.jclass.chart3d.Chart3dGridDataModel dataSource)
          Sets the data values from a data source and processes the data.
protected  void setXGrid(double[] xGrid)
          Sets the X grid array.
 void setXLabels(String[] xLabels)
          Sets the X data labels for this Chart3dGridData object.
 void setXLabelsArrayList(ArrayList xLabelsArrayList)
          Set the X data labels for this Chart3dGridData object as an array list.
protected  void setYGrid(double[] yGrid)
          Sets the Y grid array.
 void setYLabels(String[] yLabels)
          Sets the Y data labels for this Chart3dGridData object.
 void setYLabelsArrayList(ArrayList yLabelsArrayList)
          Set the Y data labels for this Chart3dGridData object as an array list.
protected  void setZValues(double[][] zValues)
          Sets the Z values array.
 
Methods inherited from class com.klg.jclass.chart3d.Chart3dData
checkValidZExtents, getClosestPoint, getDataHandler, getDataMax, getDataMin, getDataSource, getDataView, getHoleValue, getMinStep, getName, getPointIndex, getScreenPoints, isDataOK, setChanged, setDataMax, setDataMin, setDataOK, setDataView, setHoleValue, setName, toString
 
Methods inherited from class com.klg.jclass.chart3d.TrackChange
getChanged, getChanged, isBatched, isChanged, isChanged, setChanged, updateFlags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xGrid

protected double[] xGrid
The array of X grid values.


yGrid

protected double[] yGrid
The array of Y grid values.


zValues

protected double[][] zValues
The grid of Z values.


numX

protected int numX
The number of X grid values used.


numY

protected int numY
The number of Y grid values used


chartStyle

protected com.klg.jclass.chart3d.JCChart3dStyle chartStyle
The chartStyle used if the chart type is a scatter plot.


xLabels

protected String[] xLabels
The X data labels for this gridData object.


yLabels

protected String[] yLabels
The Y data labels for this gridData object.


xLabelsArrayList

protected ArrayList xLabelsArrayList
The X data labels for this gridData object in an array list. If this list is non-null, the xLabels property is ignored.


yLabelsArrayList

protected ArrayList yLabelsArrayList
The Y data labels for this gridData object in an array list. If this list is non-null, the yLabels property is ignored.


gridLimits

protected com.klg.jclass.chart3d.GridLimits gridLimits

minXStep

protected double minXStep

minYStep

protected double minYStep
Constructor Detail

Chart3dGridData

public Chart3dGridData()
Basic constructor. Data arrays are set to null.


Chart3dGridData

public Chart3dGridData(com.klg.jclass.chart3d.Chart3dDataView dataView,
                       com.klg.jclass.chart3d.Chart3dGridDataModel data)
Internal constructor specifying parent data view and arrays holding data.

Parameters:
dataView - The parent data view
data - The data model from which to extra data
Method Detail

getNumX

public int getNumX()
This is the number of X points that is actually used (this may not match xGrid.length)

Returns:
The number of X points used

getNumY

public int getNumY()
This is the number of Y points that is actually used (this may not match yGrid.length)

Returns:
The number of Y points used

getX

public double getX(int i)
Returns the X value at the specified index.

Parameters:
i - The index of the X grid value to be retrieved
Returns:
TheX value at the specified index.

getY

public double getY(int i)
Returns the Y value at the specified index.

Parameters:
i - The index of the Y grid value to be retrieved
Returns:
TheY value at the specified index.

getXGrid

public double[] getXGrid()
Returns the X grid array.

Returns:
The current X grid array

setXGrid

protected void setXGrid(double[] xGrid)
Sets the X grid array. Internal use only! This method should never be called by any object other than the dataHandler and thus should never be made public. Use the data model mechanism to set the X grid array.

Parameters:
xGrid - The new xGrid array

getYGrid

public double[] getYGrid()
Returns the Y grid array.

Returns:
The current X grid array

setYGrid

protected void setYGrid(double[] yGrid)
Sets the Y grid array. Internal use only! This method should never be called by any object other than the dataHandler and thus should never be made public. Use the data model mechanism to set the Y grid array.

Parameters:
yGrid - The new yGrid array

getZValue

public double getZValue(int x,
                        int y)
Returns the data value (or z value) that corresponds to grid point (x, y).

Parameters:
x - The x index of the data value
y - The y index of the data value
Returns:
The data value at (x, y)

getZValues

public double[][] getZValues()
Returns the entire zValues array.

Returns:
The doubly index z values array

setZValues

protected void setZValues(double[][] zValues)
Sets the Z values array. Internal use only! This method should never be called be any object other than the dataHandler and thus should never be made public. Use the data model mechanism to set the Z values array.

Parameters:
zValues - The new zValues array

getXLabels

public String[] getXLabels()
Returns the X data labels for this Chart3dGridData object

Returns:
The current X data labels

setXLabels

public void setXLabels(String[] xLabels)
Sets the X data labels for this Chart3dGridData object.

Parameters:
xLabels - The new X data labels

getXLabelsArrayList

public ArrayList getXLabelsArrayList()
Get the X data labels for this Chart3dGridData object in an array list. If this property is non-null, the xLabels property is ignored.

Returns:
The current X data labels ArrayList

setXLabelsArrayList

public void setXLabelsArrayList(ArrayList xLabelsArrayList)
Set the X data labels for this Chart3dGridData object as an array list. If this property is non-null, the xLabels property is ignored. In this array list you can specify xLabels as a list of Strings, JCValueLabels, or other objects (or a mixture of these types). For each data label, if the object is a JCValueLabel, a copy of it is used internally (the value is ignored). If it is a String, it is used as is. If it is any other object, the value of is "toString()" method is used as the label.

Parameters:
xLabelsArrayList - The new X data labels ArrayList
See Also:
setXLabelsArrayList(java.util.ArrayList)

getYLabels

public String[] getYLabels()
Returns the Y data labels.

Returns:
The current Y data labels for this Chart3dGridData

setYLabels

public void setYLabels(String[] yLabels)
Sets the Y data labels for this Chart3dGridData object.

Parameters:
yLabels - The new Y data labels

getYLabelsArrayList

public ArrayList getYLabelsArrayList()
Get the Y data labels for this Chart3dGridData object in an array list. If this property is non-null, the yLabels property is ignored.

Returns:
The current Y data labels ArrayList
See Also:
setYLabelsArrayList(java.util.ArrayList)

setYLabelsArrayList

public void setYLabelsArrayList(ArrayList yLabelsArrayList)
Set the Y data labels for this Chart3dGridData object as an array list. If this property is non-null, the yLabels property is ignored. In this array list you can specify yLabels as a list of Strings, JCValueLabels, or other objects (or a mixture of these types). For each data label, if the object is a JCValueLabel, a copy of it is used internally (the value is ignored). If it is a String, it is used as is. If it is any other object, the value of is "toString()" method is used as the label.

Parameters:
yLabelsArrayList - The new Y data labels ArrayList

setChartStyle

public void setChartStyle(com.klg.jclass.chart3d.JCChart3dStyle chartStyle)
Sets the chart style for this grid data object. This is used for rendering the line style and symbol style of the grid points when the chart type is JCChart3d.SCATTER and no contours or zones are being drawn.

Parameters:
chartStyle - The new JCChartStyle for this object

getChartStyle

public com.klg.jclass.chart3d.JCChart3dStyle getChartStyle()
Gets the chart style for this grid data object. This is used for rendering the line style and symbol style of the grid points when the chart type is JCChart3d.SCATTER and no contours or zones are being drawn.

Returns:
The chart style for this grid data object

setAllXYZValues

protected void setAllXYZValues(double[] xGrid,
                               double[] yGrid,
                               double[][] zValues)
Sets the X grid, Y grid, and Z values arrays. Internal use only! This method should never be called be any object other than the dataHandler and thus should never be made public. Use the data model mechanism to set the Z values array.

Parameters:
xGrid - The new xGrid array
yGrid - The new yGrid array
zValues - The new z values array

setDataSource

protected void setDataSource(com.klg.jclass.chart3d.Chart3dGridDataModel dataSource)
Sets the data values from a data source and processes the data. Internal use only! Use the com.klg.jclass.chart3d.Chart3dDataView#setElevationDataSource or com.klg.jclass.chart3d.Chart3dDataView#setZoneDataSource to set the data source on this object. Note that setChanged does not get called because the only place this should get called from is the parent dataView (which will handle setChanged).

Parameters:
dataSource - The new data source from which to extract data

getGridLimits

public com.klg.jclass.chart3d.GridLimits getGridLimits()
Returns the current GridLimits object. This object stores the x and y start and stop indices that the chart actually uses based on the current x and y axis min and max (if these are within their default values, only part of the grid will be drawn).

Returns:
The current GridLimits object

getMinXStep

public double getMinXStep()
Retrieves the minimum difference between x grid values.

Returns:
The minimum x step value

getMinYStep

public double getMinYStep()
Retrieves the minimum difference between y grid values.

Returns:
The minimum y step value

getXClosest

public int getXClosest(double x)
Returns the index that contains the x value closest to the specified value.

Parameters:
x - The value for which the closest index should be found
Returns:
The closest x index

getYClosest

public int getYClosest(double y)
Returns the index that contains the y value closest to the specified value.

Parameters:
y - The value for which the closest index should be found
Returns:
The closest y index

processData

protected void processData()
Calculates the data array lengths that can be used and value of dataOK.


matchData

protected boolean matchData(com.klg.jclass.chart3d.Chart3dGridData data)
Checks to see if the grid from the passed in data matches the grid from this data. Needed to see if surface and zone data are compatible.

Parameters:
data - The data object whose data needs to match the data of this object
Returns:
Whether the passed in data matches the data from this object

computeZLimits

protected void computeZLimits(com.klg.jclass.chart3d.Chart3dGridData data,
                              double oldMin,
                              double oldMax)
Computes the Z min and max data values and store these in dataMin and dataMax.

Parameters:
data - If not null, use as a zone data object
oldMin - The old data min (if this one can't be computed for some reason)
oldMax - The old data max (if this one can't be computed for some reason)

calcLimits

protected void calcLimits(com.klg.jclass.chart3d.Chart3dGridData zoneData)
Calculates and sets the axis limits, grid limits, and the contour limits.

Parameters:
zoneData - A zone data object that may have valid data

precomputePoints

public void precomputePoints()
Precomputes the screen points for each of the grid values

Specified by:
precomputePoints in class Chart3dData

calcAnnoLimits

protected void calcAnnoLimits()
Makes a first rough pass at the annotation limits, extending the axis limits out to include the origin and making sure that bars fit within the axis.

Specified by:
calcAnnoLimits in class Chart3dData

getGridIndex

public int getGridIndex(double t,
                        boolean isXArray,
                        boolean transform)
Returns the largest x or y grid index that the value 't' is greater than. This function is used for determining the facet on the grid within which a point is contained. For fixed bars and scatter plots the closest grid line index is returned.

Parameters:
t - The value for which the index needs to be found
isXArray - Is this an x array or y array
transform - Should the point be transformed before searching
Returns:
The largest x or y grid number that the value 't' is greater than.

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