|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.chart3d.TrackChange | +--com.klg.jclass.chart3d.Chart3dDataView
Class containing the internal representation of the chartable data.
Chart3d data is represented as elevation data and zone data (used for 4D
grid plots). User pass in a data source which the dataView extracts into
an internal data object. The internal data object is then used to plot
the data.
The Chart3dDataView
also manages the drawing of the data,
handles changes to the data through Chart3dDataEvent
objects
that are passed to it, and handles mapping and picking.
Field Summary | |
protected boolean |
batched
|
protected com.klg.jclass.chart3d.JCChart3d |
chart3d
The parent JCChart3d object. |
protected int |
chartType
The chart type of this dataView . |
protected com.klg.jclass.chart3d.JCContour |
contour
The JCContour object handles contouring and zoning. |
static int |
CONTOURED
|
protected boolean |
dataDrawn
|
protected com.klg.jclass.chart3d.Chart3dDataHandler |
dataHandler
|
protected int |
dataViewId
|
protected boolean |
defaultsCalculated
|
protected com.klg.jclass.chart3d.Draw |
draw
The object used by this dataView to draw the data. |
protected int |
drawCode
|
protected com.klg.jclass.chart3d.JCElevation |
elevation
The JCElevation object determines meshing, shading, and
transparency. |
protected com.klg.jclass.chart3d.Chart3dData |
elevationData
The internal elevation data object. |
protected com.klg.jclass.chart3d.Chart3dDataModel |
elevationDataSource
Elevation data source for this dataView . |
protected ArrayList |
gridColors
Allows certain facets or bars to have different colors. |
protected com.klg.jclass.chart3d.Mapping |
mapping
|
static int |
MESHED
|
protected double |
mouseEditScaleFactor
|
protected String |
name
The name of this dataView . |
protected double |
radiusOfInfluence
In Chart3d Java3d, when editing a SURFACE chart using the mouse, data points around the pick point are modified according to the expression deltaZ = scaleFactor * mouseDragDistance * exp(-distanceFromPickPoint/radiusOfInfluence) where deltaZ is the change in the z coordinate value of a given point, scaleFactor = (MaxDataValue - MinDataValue) * mouseEditScaleFactor, mouseDragDistance is the mouse drag distance along the adjustment axis, distanceFromPickPoint is the distance in the x,y plane of a data point from the pick point, radiusOfInfluence is a user-specified parameter. |
static int |
SHADED
|
static int |
ZONED
|
protected com.klg.jclass.chart3d.Chart3dGridData |
zoneData
The internal zone data object. |
protected com.klg.jclass.chart3d.Chart3dGridDataModel |
zoneDataSource
Zone data source for this dataView . |
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 | |
Chart3dDataView()
Null args constructor. |
|
Chart3dDataView(com.klg.jclass.chart3d.JCChart3d chart3d,
int dataViewId)
Constructor which provides a parent chart3d and a
dataViewId . |
|
Chart3dDataView(com.klg.jclass.chart3d.JCChart3d chart3d,
int dataViewId,
int chartType)
Constructor which provides a parent chart3d ,
a dataViewId , and a chartType . |
Method Summary | |
void |
addGridColor(int x,
int y,
Color color)
Sets the color of the specified bar (or set of bars) by creating a JCGridColor and adding it to the gridColors
ArrayList . |
void |
addGridColor(com.klg.jclass.chart3d.JCGridColor gridColor)
Sets the color of the specified bar (or set of bars) by adding the passed in gridColor to the gridColors
ArrayList . |
void |
calcDefaults()
Calculates default values for those values that were not provided by the user. |
void |
chart3dDataChange(com.klg.jclass.chart3d.event.Chart3dDataEvent event)
chart3dDataChange is called whenever the chart 3D data has
changed. |
protected void |
computeDataDrawn()
Will we draw anything? Computes a drawCode (for easier access
to the four booleans that control the type of surface, bar, or scatter plot). |
void |
computeDataLimits()
Computes the limits of the data (i.e. |
Point3d |
coordToDataCoord(int x,
int y)
Same as map(). |
com.klg.jclass.chart3d.JCData3dIndex |
coordToDataIndex(int x,
int y)
Similar to pick() for a specific data view. |
void |
createDraw()
Creates the correct draw object based on the data type. |
Point |
dataCoordToCoord(Point3d point)
Same as unmap(). |
Point |
dataIndexToCoord(com.klg.jclass.chart3d.JCData3dIndex index)
Similar to unpick() for a specific this specific data view. |
protected void |
doPreprocessing()
Does preprocessing needed before drawing. |
double |
dragZValue(com.klg.jclass.chart3d.Chart3dData data,
com.klg.jclass.chart3d.JCData3dIndex index,
int x,
int y)
Finds a new Z value for a given point based on a given pixel position. |
protected void |
drawGraph(Graphics gc)
Actually draws the graph. |
protected void |
filterGridColors()
Processes gridColors . |
com.klg.jclass.chart3d.JCGridColor |
findGridColor(int x,
int y)
Finds the first JCGridColor (starting at the end of the list) in
the gridColors list that matches the indices (x, y). |
com.klg.jclass.chart3d.JCChart3d |
getChart3d()
Returns the parent JCChart3d object. |
int |
getChartType()
Return the chart type for this dataView. |
com.klg.jclass.chart3d.JCContour |
getContour()
Returns the current JCContour object for this
dataView . |
int |
getDataViewId()
Gets the dataView ID number. |
com.klg.jclass.chart3d.Draw |
getDraw()
Returns the object used to draw the data. |
int |
getDrawCode()
Returns the current draw code mask. |
com.klg.jclass.chart3d.JCElevation |
getElevation()
Returns the current JCElevation object for this
dataView . |
com.klg.jclass.chart3d.Chart3dData |
getElevationData()
Returns the internal elevation data object. |
com.klg.jclass.chart3d.Chart3dDataModel |
getElevationDataSource()
Gets the elevationDataSource property for
Chart3dDataView . |
ArrayList |
getGridColors()
Returns the current list of grid colors. |
com.klg.jclass.chart3d.Mapping |
getMapping()
Returns the current mapping object. |
double |
getMouseEditScaleFactor()
This method returns the mouseEditScaleFactor used in mouse editing of a SURFACE, BAR, or SCATTER chart. |
String |
getName()
Gets the dataView 's name. |
double |
getRadiusOfInfluence()
This method returns the value of the radiusOfInfluence parameter used in mouse editing of a SURFACE chart. |
com.klg.jclass.chart3d.Chart3dGridData |
getZoneData()
Returns the internal zone data object. |
com.klg.jclass.chart3d.Chart3dGridDataModel |
getZoneDataSource()
Gets the zoneDataSource property for
Chart3dDataView . |
double |
gridValue(com.klg.jclass.chart3d.Chart3dGridData data,
double x,
double y)
Given grid data and an (x,y) point on the visible xy plane within the grid, do bilinear interpolation using the 4 closest grid points and return the corresponding z value. |
boolean |
isBatched()
Gets the Batched property. |
boolean |
isDataDrawn()
Based on user inputs, is there any data drawn? If the user input data that doesn't make sense (i.e. |
Point3d |
map(int x,
int y)
Performs a map operation by mapping the provided screen pixel information to a point in 3d space that is on the surface (if the point misses the surface a point with (x, y, z) values of Double.MAX_VALUE is returned. |
boolean |
removeGridColor(int x,
int y)
Removes the first matching entry from the gridColors
ArrayList (starting from the last to the first). |
protected boolean |
removeGridColor(int x,
int y,
int n,
boolean callSetChanged)
Removes the first matching entry from the gridColors
ArrayList (starting from the nth entry back to the
first). |
void |
setBatched(boolean isBatched)
Sets the Batched property. |
void |
setChanged(boolean b,
int cf)
Sets the value of the Changed property. |
void |
setChanged(boolean b,
int cf,
boolean updateParent)
Sets the value of the Changed property, with option to prevent parent
updating via the updateParent parameter. |
void |
setChart3d(com.klg.jclass.chart3d.JCChart3d chart3d)
Sets the parent JCChart3d object. |
void |
setChartType(int chartType)
Sets the chart type for this dataView . |
void |
setContour(com.klg.jclass.chart3d.JCContour contour)
Sets a JCContour object on this dataView . |
void |
setDataViewId(int dataViewId)
Sets the dataView ID number. |
void |
setElevation(com.klg.jclass.chart3d.JCElevation elevation)
Sets a JCElevation object for this dataView . |
void |
setElevationDataSource(com.klg.jclass.chart3d.Chart3dDataModel elevationDataSource)
Sets the elevation data source for this Chart3dDataView . |
void |
setGridColors(ArrayList gridColors)
Sets the grid color list. |
void |
setMapping(com.klg.jclass.chart3d.Mapping mapping)
Sets the mapping object. |
void |
setMouseEditScaleFactor(double factor)
This method sets the mouseEditScaleFactor used in mouse editing of a SURFACE, BAR, or SCATTER chart. |
void |
setName(String name)
Sets the dataView 's name. |
void |
setRadiusOfInfluence(double radius)
This method sets the radiusOfInfluence parameter used in mouse editing of a SURFACE chart. |
void |
setZoneDataSource(com.klg.jclass.chart3d.Chart3dGridDataModel zoneDataSource)
Sets the zone data source for this Chart3dDataView . |
Point |
unmap(Point3d point)
Performs an unmap operation by taking a point in 3d data space and transforming it to screen space. |
Methods inherited from class com.klg.jclass.chart3d.TrackChange |
getChanged, getChanged, isChanged, isChanged, updateFlags |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MESHED
public static final int SHADED
public static final int ZONED
public static final int CONTOURED
protected com.klg.jclass.chart3d.JCChart3d chart3d
JCChart3d
object.
protected com.klg.jclass.chart3d.Chart3dDataModel elevationDataSource
dataView
. The elevation data is
the primary data for the dataView
and provides a surface plot,
bar plot, or scatter plot depending on the chartType
.
protected com.klg.jclass.chart3d.Chart3dData elevationData
elevationDataSource
.
protected com.klg.jclass.chart3d.Chart3dGridDataModel zoneDataSource
dataView
. Zone data allows color to
be a 4th dimension for the corresponding elevation data. The underlying grid
needs to match the elevation data's underlying grid.
protected com.klg.jclass.chart3d.Chart3dGridData zoneData
zoneDataSource
.
protected int chartType
dataView
. One of SURFACE
,
BAR
, or SCATTER
.
JCChart3d
protected com.klg.jclass.chart3d.JCElevation elevation
JCElevation
object determines meshing, shading, and
transparency.
protected com.klg.jclass.chart3d.JCContour contour
JCContour
object handles contouring and zoning.
protected String name
dataView
. Used by the legend code and the
customizer.
protected ArrayList gridColors
protected com.klg.jclass.chart3d.Draw draw
dataView
to draw the data.
protected com.klg.jclass.chart3d.Mapping mapping
protected com.klg.jclass.chart3d.Chart3dDataHandler dataHandler
protected boolean dataDrawn
protected int drawCode
protected boolean defaultsCalculated
protected int dataViewId
protected boolean batched
protected double radiusOfInfluence
protected double mouseEditScaleFactor
Constructor Detail |
public Chart3dDataView()
chart3d
is null (which
is not a good thing because many child objects call the
getChart3d()
method and expect a valid JCChart3d
object to be there).
public Chart3dDataView(com.klg.jclass.chart3d.JCChart3d chart3d, int dataViewId)
chart3d
and a
dataViewId
.
chart3d
- The parent chart3ddataViewId
- The dataView index into the master dataView arraypublic Chart3dDataView(com.klg.jclass.chart3d.JCChart3d chart3d, int dataViewId, int chartType)
chart3d
,
a dataViewId
, and a chartType
.
chart3d
- The parent chart3ddataViewId
- The dataView index into the master dataView arraychartType
- Method Detail |
public com.klg.jclass.chart3d.JCChart3d getChart3d()
JCChart3d
object.
public void setChart3d(com.klg.jclass.chart3d.JCChart3d chart3d)
JCChart3d
object.
chart3d
- The new parent JCChart3d objectpublic com.klg.jclass.chart3d.Chart3dDataModel getElevationDataSource()
elevationDataSource
property for
Chart3dDataView
. This elevationDataSource
property
represents the class used to load data into the Chart3dDataView
class. The elevationDataSource
property holds this populating
class if it implements either EditableChart3dDataModel
or
Chart3dDataManager
. If the elevationDataSource
property is null, that means that the populating data source class was
discarded because it was no longer needed.
EditableChart3dDataModel
or
Chart3dDataManager
.public void setElevationDataSource(com.klg.jclass.chart3d.Chart3dDataModel elevationDataSource)
Chart3dDataView
. The
data source class must implement either Chart3dDataModel
or
EditableChart3dDataModel
. JClass Chart 3D will do the
correct operation based on the object provided.
If this data source class implements Chart3dDataManager
,
this data view will be registered as a listener for data changes.
The data source class will be saved in the elevationDataSource
propertyfor future reference if it implements either
Chart3dDataManager
or EditableChart3dDataModel
.
Otherwise, since it is only needed to load data once,
the elevationDataSource
property will be set to null.
elevationDataSource
- Object acting as a elevation data source for
Chart3dDataView; this object must implement either
Chart3dDataModel
or EditableChart3dDataModel
.public com.klg.jclass.chart3d.Chart3dData getElevationData()
Chart3dDataEvents
.
public com.klg.jclass.chart3d.Chart3dGridDataModel getZoneDataSource()
zoneDataSource
property for
Chart3dDataView
. This property allows the user to add a 4th
dimension to the data based on color. This zoneDataSource
property represents the class used to load data into the
Chart3dDataView
class. The zoneDataSource
property
holds this populating class if it implements either
EditableChart3dDataModel
or Chart3dDataManager
.
If the zoneDataSource
property is null, that means that the
populating data source class was discarded because it was no longer needed.
Chart3dDataView
;
this object implements either EditableChart3dDataModel
or
Chart3dDataManager
.public void setZoneDataSource(com.klg.jclass.chart3d.Chart3dGridDataModel zoneDataSource)
Chart3dDataView
. The
data source class must implement either Chart3dGridDataModel
or
EditableChart3dGridDataModel
. JClass Chart 3D will do the
correct operation based on the object provided.
If this data source class implements Chart3dGridDataManager
,
this data view will be registered as a listener for data changes.
The data source class will be saved in the zoneDataSource
property for future reference if it implements either
Chart3dDataManager
or EditableChart3dDataModel
.
Otherwise, since it is only needed to load data once,
the zoneDataSource
property will be set to null.
zoneDataSource
- Object acting as a zone data source for
Chart3dDataView
; this object must implement either
Chart3dGridDataModel
or
EditableChart3dGridDataModel
.public com.klg.jclass.chart3d.Chart3dGridData getZoneData()
Chart3dDataEvents
.
public boolean isDataDrawn()
Chart3dPointDataModel
when the chartType
is
SURFACE,/code>) or invalid data (i.e. an object the implements the
Chart3dGridDataModel
which has less than two x or
y grid values) this flag will return false and nothing will be drawn
in the JCChart3dArea
.
- Returns:
- Is there any data drawn?
public int getDrawCode()
OR
of
the MESHED
, SHADED
, CONTOURED
, and
ZONED
masks which are set based on the corresponding properties
in the child JCContour
and JCElevation
objects.
This is meant to be used as an internal mask but is exposed if users want to
query it. Note that this mask gets set somewhere during the drawing process.
public int getDataViewId()
dataView
ID number. This number is index into the
master dataView
array stored in the parent
JCChart3d
class.
dataView
ID numberpublic void setDataViewId(int dataViewId)
dataView
ID number. This number is index into the
master dataView
array stored in the parent
JCChart3d
class. Note that currently only one dataView is
supported.
dataViewId
- The new dataView
ID numberpublic int getChartType()
JCChart3d
public void setChartType(int chartType)
dataView
. This is one of
SURFACE
, BAR
, or SCATTER
(defined in
the JCChart3d
class).
chartType
- JCChart3d
public String getName()
dataView
's name. The name is used in the legend and
customizer to distinguish between dataViews
.
dataView
namepublic void setName(String name)
dataView
's name. The name is used in the legend and
customizer to distinguish between dataViews
.
name
- The new dataView
namepublic ArrayList getGridColors()
public void setGridColors(ArrayList gridColors)
gridColors
- The new grid color listpublic com.klg.jclass.chart3d.JCGridColor findGridColor(int x, int y)
JCGridColor
(starting at the end of the list) in
the gridColors
list that matches the indices (x, y).
x
- The x index to matchy
- The y index to matchprotected boolean removeGridColor(int x, int y, int n, boolean callSetChanged)
gridColors
ArrayList
(starting from the nth entry back to the
first). The entry must match exactly (x ==
JCData3dIndex.ALL
will only match if the
gridColor
's index is JCData3dIndex.ALL
).
Internal use only.
x
- The x index of the grid color to be removedy
- The y index of the grid color to be removedn
- The number of grid colors in the array to scan (could be less
than gridColors.size())callSetChanged
- If true, mark the dataView as changed and redraw.public boolean removeGridColor(int x, int y)
gridColors
ArrayList
(starting from the last to the first). The entry must
match exactly (x == JCData3dIndex.ALL
will only match if
the gridColor
's index is JCData3dIndex.ALL
).
x
- The x index of the grid color to be removedy
- The y index of the grid color to be removedpublic void addGridColor(int x, int y, Color color)
JCGridColor
and adding it to the gridColors
ArrayList
. If the x and y of the
gridColor
match an entry already on the list then that entry
will be replaced by the new one. If the color of the gridColor
is null, then remove the matching entry without replacing it.
x
- The x index of the grid color to be addedy
- The y index of the grid color to be addedcolor
- The color of the grid color to be addedpublic void addGridColor(com.klg.jclass.chart3d.JCGridColor gridColor)
gridColor
to the gridColors
ArrayList
. If the x and y of the
gridColor
match an entry already on the list then that entry
will be replaced by the new one. If the color of the gridColor
is null, then remove the matching entry without replacing it.
gridColor
- The gridColor object to be added.protected void filterGridColors()
gridColors
. Starting at the first entry, basically
act like you are adding each entry to a new list. Duplicate entries will
replace old ones and null colors will wipe out a matching entry. Note that
any new entry always be placed at the end of the list.
public com.klg.jclass.chart3d.Draw getDraw()
public com.klg.jclass.chart3d.JCElevation getElevation()
JCElevation
object for this
dataView
.
public void setElevation(com.klg.jclass.chart3d.JCElevation elevation)
JCElevation
object for this dataView
.
Setting the elevation property to null not allowed.
elevation
- The new JCElevation
objectionpublic com.klg.jclass.chart3d.JCContour getContour()
JCContour
object for this
dataView
.
public void setContour(com.klg.jclass.chart3d.JCContour contour)
JCContour
object on this dataView
. Note
that since the JCContour
object is heavily dependent on the
Chart3dDataView
's data (among other things), a contour object
can only have one dataView
parent. Also, setting the contour
property to null not allowed.
contour
- The new JCContour
objectpublic com.klg.jclass.chart3d.Mapping getMapping()
public void setMapping(com.klg.jclass.chart3d.Mapping mapping)
mapping
- The new mapping objectpublic boolean isBatched()
Batched
property. The Batched
property
controls whether the Chart3dDataView
is notified immediately
of data model changes, or if the changes are accumulated and sent at a
later date.
isBatched
in interface Changeable
isBatched
in class TrackChange
public void setBatched(boolean isBatched)
Batched
property. The Batched
property
controls whether the Chart3dDataView
is notified immediately of
data model changes, or if the changes are accumulated and sent at a later date.
isBatched
- Are updates batched until later?public void chart3dDataChange(com.klg.jclass.chart3d.event.Chart3dDataEvent event)
chart3dDataChange
is called whenever the chart 3D data has
changed. Interested listeners should implement this method and register the
object with the appropriate data source.
chart3dDataChange
in interface Chart3dDataListener
event
- The data event to processpublic void setChanged(boolean b, int cf)
Changed
property. The Changed
property manages whether the data view requires recalculation. If set to
true, a recalculation may be triggered.
setChanged
in interface Changeable
setChanged
in class TrackChange
b
- Has anything been changed?cf
- The change mask the tells what type of changed has happenedpublic void setChanged(boolean b, int cf, boolean updateParent)
Changed
property, with option to prevent parent
updating via the updateParent
parameter. This method overrides the
TrackChange
method so that it can mark other appropriate objects as
changed.
Note that updateParent
is independent of Batched
.
setChanged
in interface Changeable
setChanged
in class TrackChange
b
- Has a change happened?cf
- The change mask that tells what type of change has happenedupdateParent
- Tell our parent about the change (which will cause
a repaint)?public void computeDataLimits()
protected void computeDataDrawn()
drawCode
(for easier access
to the four booleans that control the type of surface, bar, or scatter plot).
Also computes another boolean dataDrawn
that determines if
anything is to be drawn.
public void calcDefaults()
public void createDraw()
protected void doPreprocessing()
protected void drawGraph(Graphics gc)
gc
- The graphics object used to drawpublic Point3d map(int x, int y)
Double.MAX_VALUE
is returned.
x
- x value in screen pixelsy
- y value in screen pixels
public Point unmap(Point3d point)
point
- The point in 3d dat space to be transformed.
public Point3d coordToDataCoord(int x, int y)
x
- x value in screen pixelsy
- y value in screen pixels
Point3d
instancepublic Point dataCoordToCoord(Point3d point)
point
- The point in 3d data space to be transformed.
public Point dataIndexToCoord(com.klg.jclass.chart3d.JCData3dIndex index)
JCData3dIndex
instance (containing a data view and an point
index for either grid data or point data) to pixel values relative to the
Chart 3D component.
index
- Object representing the index of the point to unpick. This is
either a JCData3dGridIndex
representing the (x,
y) index of grid data point or a JCData3dPointIndex
representing the (series, point) index of a point in a point data set.
public com.klg.jclass.chart3d.JCData3dIndex coordToDataIndex(int x, int y)
pick()
for a specific data view. Converts pixel values
relative to the Chart 3D component to a JCData3dIndex
instance
representing the index of the picked point. This is either a
JCData3dGridIndex
representing the (x, y) index of
grid data point or a JCData3dPointIndex
representing the (series,
point) index of a point in a point data set.
x
- The x value of screen positiony
- The y value of screen position
JCData3dIndex
object representing the index of the
picked point.public double dragZValue(com.klg.jclass.chart3d.Chart3dData data, com.klg.jclass.chart3d.JCData3dIndex index, int x, int y)
data
- The data for which this operation is to take place. It is
either an instance of Chart3dGridData
or
Chart3dPointData
.index
- The data index of the point. For grid data, this must be an
instance of JCData3dGridIndex
, which corresponds to an
x and y grid position specification. For point data, this
must be an instance of JCData3dPoint
index which corresponds
to the series and point number of the point.x
- The x value of screen positiony
- The y value of screen position
public double gridValue(com.klg.jclass.chart3d.Chart3dGridData data, double x, double y)
JChart3dUtil.biLinearInterp();
.
data
- The internal grid data object. This can be retrieved from a
Chart3dDataView
object via getElevationData()
or getZoneData()
.x
- The x data-space valuey
- The y data-space value
getElevationData()
,
getZoneData()
,
JCChart3dUtil.biLinearInterp(com.klg.jclass.chart3d.Chart3dGridData, int, int, double, double)
public void setRadiusOfInfluence(double radius)
public double getRadiusOfInfluence()
public void setMouseEditScaleFactor(double factor)
public double getMouseEditScaleFactor()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |