JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart3d
Class Chart3dData

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

public abstract class Chart3dData
extends TrackChange

Base object for JCChart3d's internal data. It stores data passed into it from a data source which implements one the Chart3d data models.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.chart3d.Chart3dDataHandler dataHandler
          A data handler used to handle data events and extract data from data sources
protected  double dataMax
          The current data's minimum Z value.
protected  double dataMin
          The current data's maximum Z value.
protected  boolean dataOK
          Is the data passed in thru the data source in a state in which it can be drawn?
protected  com.klg.jclass.chart3d.Chart3dDataModel dataSource
          The data source for this internal data object
protected  com.klg.jclass.chart3d.Chart3dDataView dataView
          The parent dataView that draws with this data object
protected  double holeValue
          The "special" data value which determines where holes are drawn
protected  String name
          The (optional) name of this data source
protected  com.klg.jclass.chart3d.ScreenPoint[][] screenPoints
          A list of screen points which represent the transformed data values and stores their pixel locations on the screen as well as some other flags.
 
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
 
Method Summary
protected abstract  void calcAnnoLimits()
          Calulate the annotation limits for this data object.
protected  void checkValidZExtents()
          Notes that user specified Z max/min values cannot be inside the data Z max/min (otherwise we need to do surface clipping).
 int getClosestPoint(double v, double[] arr, int n)
          Finds the closest match to a value in an array of doubles.
 com.klg.jclass.chart3d.Chart3dDataHandler getDataHandler()
          Returns the data handler for this data object.
 double getDataMax()
          Retrieves the data max value (computed in sub-class).
 double getDataMin()
          Retrieves the data min value (computed in sub-class).
 com.klg.jclass.chart3d.Chart3dDataModel getDataSource()
          Returns the current data source for this data object.
 com.klg.jclass.chart3d.Chart3dDataView getDataView()
          Gets the value of the dataView property.
 double getHoleValue()
          Retrieves the hole value for the data.
 double getMinStep(double[] arr, int n)
          Finds the minimum delta (or step) in an array of doubles.
 String getName()
          Gets the value of the name property.
 int getPointIndex(double t, double[] arr, int n)
          Usees a binary search to look for the value 't' in the array 'arr'.
 com.klg.jclass.chart3d.ScreenPoint[][] getScreenPoints()
          Returns the list of precomputed screen points for this data set.
 boolean isDataOK()
          Is the data valid? In other words, can it be used to draw a surface, bar, or scatter plot.
abstract  void precomputePoints()
          Precompute the screen points (to avoid repeatedly transforming points)
 void setChanged(boolean n, int cf)
          Overrides setChanged so that the flags are updated, passed on to the parent dataView, and then reset.
protected  void setDataMax(double dataMax)
          Sets the data max value (usually set by sub-class).
protected  void setDataMin(double dataMin)
          Sets the data min value (usually set by sub-class).
protected  void setDataOK(boolean dataOK)
          Sets whether the data is valid or not (internal use only).
 void setDataView(com.klg.jclass.chart3d.Chart3dDataView dataView)
          Sets the parent dataView.
protected  void setHoleValue(double holeValue)
          Sets the hole value for the data (internal use only).
 void setName(String name)
          Sets the value of the name property.
 String toString()
          Returns string representation of this data object.
 
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

dataView

protected com.klg.jclass.chart3d.Chart3dDataView dataView
The parent dataView that draws with this data object


holeValue

protected double holeValue
The "special" data value which determines where holes are drawn


name

protected String name
The (optional) name of this data source


dataOK

protected boolean dataOK
Is the data passed in thru the data source in a state in which it can be drawn?


dataSource

protected com.klg.jclass.chart3d.Chart3dDataModel dataSource
The data source for this internal data object


dataHandler

protected com.klg.jclass.chart3d.Chart3dDataHandler dataHandler
A data handler used to handle data events and extract data from data sources


dataMin

protected double dataMin
The current data's maximum Z value. Readonly.


dataMax

protected double dataMax
The current data's minimum Z value. Readonly.


screenPoints

protected com.klg.jclass.chart3d.ScreenPoint[][] screenPoints
A list of screen points which represent the transformed data values and stores their pixel locations on the screen as well as some other flags.

Method Detail

getDataView

public com.klg.jclass.chart3d.Chart3dDataView getDataView()
Gets the value of the dataView property. The dataView property points to the containing Chart3dDataView for this data object

Returns:
The current parent data view for this object
See Also:
Chart3dDataView

setDataView

public void setDataView(com.klg.jclass.chart3d.Chart3dDataView dataView)
Sets the parent dataView.

Parameters:
dataView - The new parent data view
See Also:
Chart3dDataView

getName

public String getName()
Gets the value of the name property. The name property represents the name of this data object. In JClass Chart 3D, data objects can be named, and can be retrieved by name.

Returns:
Data object name.

setName

public void setName(String name)
Sets the value of the name property. The name property represents the name of the data object. In JClass Chart 3D, data objects can be named, and can be retrieved by name.

Parameters:
name - The new name of the data object

isDataOK

public boolean isDataOK()
Is the data valid? In other words, can it be used to draw a surface, bar, or scatter plot. This object checks all data passed in to see if it is valid.


setDataOK

protected void setDataOK(boolean dataOK)
Sets whether the data is valid or not (internal use only).

Parameters:
dataOK - The new value of dataOK.

getHoleValue

public double getHoleValue()
Retrieves the hole value for the data.

Returns:
The current hole value

setHoleValue

protected void setHoleValue(double holeValue)
Sets the hole value for the data (internal use only). Users should not set the hole value thru this method but rather thru the HoleValueChart3dDataModel interface.

Parameters:
holeValue - The new hole value

getDataMin

public double getDataMin()
Retrieves the data min value (computed in sub-class). Readonly.


setDataMin

protected void setDataMin(double dataMin)
Sets the data min value (usually set by sub-class). Internal use only!

Parameters:
dataMin - The new dataMin value.

getDataMax

public double getDataMax()
Retrieves the data max value (computed in sub-class).


setDataMax

protected void setDataMax(double dataMax)
Sets the data max value (usually set by sub-class). Internal use only!

Parameters:
dataMax - The new dataMax value

getDataSource

public com.klg.jclass.chart3d.Chart3dDataModel getDataSource()
Returns the current data source for this data object.

Returns:
The current data source

getDataHandler

public com.klg.jclass.chart3d.Chart3dDataHandler getDataHandler()
Returns the data handler for this data object. A data handler is used to handle data events and extract data from data sources

Returns:
The current data handler

getScreenPoints

public com.klg.jclass.chart3d.ScreenPoint[][] getScreenPoints()
Returns the list of precomputed screen points for this data set.

Returns:
The precomputed screen points

toString

public String toString()
Returns string representation of this data object. If it has a name, use that.

Overrides:
toString in class Object

getClosestPoint

public int getClosestPoint(double v,
                           double[] arr,
                           int n)
Finds the closest match to a value in an array of doubles.

Parameters:
v - The input value (for closest match)
arr - The array to search
n - The size of the array (could be less than arr.length).

getPointIndex

public int getPointIndex(double t,
                         double[] arr,
                         int n)
Usees a binary search to look for the value 't' in the array 'arr'. The index with the value closest to 't' but less than 't' is returned. The index returned is in the range [0..n-1].

Parameters:
t - The value to find
arr - The array to search
n - The size of the array (could be less than arr.length).

getMinStep

public double getMinStep(double[] arr,
                         int n)
Finds the minimum delta (or step) in an array of doubles.

Parameters:
arr - The array to search
n - The size of the array (could be less than arr.length).

checkValidZExtents

protected void checkValidZExtents()
Notes that user specified Z max/min values cannot be inside the data Z max/min (otherwise we need to do surface clipping).


setChanged

public void setChanged(boolean n,
                       int cf)
Overrides setChanged so that the flags are updated, passed on to the parent dataView, and then reset.

Specified by:
setChanged in interface Changeable
Overrides:
setChanged in class TrackChange
Parameters:
n - Has anything changed?
cf - The change mask which tells the type of change

precomputePoints

public abstract void precomputePoints()
Precompute the screen points (to avoid repeatedly transforming points)


calcAnnoLimits

protected abstract void calcAnnoLimits()
Calulate the annotation limits for this data object. This might be different than the data limits, since fixed bars extend outside of the data range and the zOrigin may be outside of the data range.


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