|
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.chart.ChartDataView
Class containing the internal representation of the chartable data.
Chart data is represented as a series of ChartDataViewSeries
objects, managed by a ChartDataView
object.
Note: ChartDataView
includes a mapping from
series number to series name.
ChartDataView
also manages the
JCChartStyles
for the data series. By
default, if no JCChartStyle
is provided
by the developer, ChartDataView
will
create a default JCChartStyle
for the
data series.
Note: This means that ChartDataView
is
not always a view -- it is
capable of being a view, but is not necessarily a view.
Field Summary | |
protected boolean |
allowPick
|
protected boolean |
autoLabel
|
protected boolean |
batched
|
protected boolean |
bufferPlotData
|
protected boolean |
changed
|
protected int |
changedFlag
|
protected com.klg.jclass.chart.JCChart |
chart
|
protected int |
chartType
|
protected com.klg.jclass.util.ImageMapInfo[] |
clusterImageMapInfo
|
protected com.klg.jclass.chart.JCDrawableColorHandler |
colorHandler
|
protected com.klg.jclass.chart.DataHandler |
dataHandler
|
protected com.klg.jclass.chart.ChartDataModel |
dataSource
|
protected static int |
dataViewNum
|
protected boolean |
drawFrontPlane
|
protected int |
drawingOrder
|
static String |
ERRMSG_INVALID_SERIES_INDEX
Error message for invalid series index. |
protected boolean |
fastUpdate
|
static String[] |
format_class_names
Class names of format classes. |
protected Hashtable |
formatClassHashtable
|
protected double |
holeValue
|
protected com.klg.jclass.util.ImageMapInfo |
imageMapInfo
|
protected boolean |
inverted
|
protected Locale |
locale
|
protected String |
name
|
protected com.klg.jclass.chart.JCLineStyle |
outlineStyle
|
protected com.klg.jclass.util.io.OutputDataProperties |
outputDataProperties
|
static int |
PICK_FOCUS_LOCAL
Enum values for pick focus. |
static int |
PICK_FOCUS_X
|
static int |
PICK_FOCUS_XY
|
static int |
PICK_FOCUS_Y
|
protected int |
pickFocus
|
protected List |
pointLabels
|
protected Vector |
series
|
protected double |
step
|
protected boolean |
visible
|
protected boolean |
visibleInLegend
|
protected boolean |
visibleInLegendChanged
|
protected com.klg.jclass.chart.JCAxis |
xaxis
|
protected com.klg.jclass.chart.MinMax |
xLimits
|
protected com.klg.jclass.chart.JCAxis |
yaxis
|
protected com.klg.jclass.chart.MinMax |
yLimits
|
Fields inherited from interface com.klg.jclass.chart.Changeable |
BASIC_CHANGE_MASK, NOTIFY_AXES_RECALC, NOTIFY_AXES_REDRAW, NOTIFY_CA_RECALC, NOTIFY_CA_REDRAW, NOTIFY_LEGEND_RECALC, NOTIFY_LEGEND_REDRAW |
Fields inherited from interface com.klg.jclass.util.Changeable |
LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW |
Constructor Summary | |
ChartDataView()
Constructor. |
Method Summary | |
void |
addSeries(com.klg.jclass.chart.ChartDataViewSeries s)
Adds a ChartDataViewSeries to the view at the end of
the list. |
com.klg.jclass.chart.ChartDataViewSeries |
addSeries(int index)
Adds a data series to the Series property at the specified
index. |
void |
calcTransientData()
Calculates data associated with view data. |
void |
chartDataChange(com.klg.jclass.chart.ChartDataEvent evt)
Implements the ChartDataListener interface. |
boolean |
checkNewPoints(int npoints)
Checks newly added points to see if they fit inside current axis bounds. |
com.klg.jclass.chart.JCDataCoord |
coordToDataCoord(int x,
int y)
Same as map() . |
com.klg.jclass.chart.JCDataIndex |
coordToDataIndex(int x,
int y,
int focus)
Similar to pick() for a specific data view. |
Point |
dataCoordToCoord(double xval,
double yval)
Same as unmap() . |
Point |
dataIndexToCoord(com.klg.jclass.chart.JCDataIndex di)
Similar to unpick() for a specific data view. |
boolean |
doFastUpdate(int column,
int nPoints)
Performs a fast update to the chart by just drawing over the current chart without doing a lot of recalcing and redrawing of existing points. |
boolean |
getAutoLabel()
Gets the AutoLabel property, which determines if a chart
automatically generates labels for each point in each series. |
boolean |
getBufferPlotData()
Gets the BufferPlotData property. |
boolean |
getChanged()
Returns the value of the Changed property. |
boolean |
getChanged(int mask)
Checks for the existence of the specified flag in the ChangedFlag property. |
com.klg.jclass.chart.JCChartTypeFormat |
getChartFormat()
Gets the Format class for the current chart type. |
com.klg.jclass.chart.JCChartTypeFormat |
getChartFormat(int type)
Gets the Format class for the specified chart type. |
List |
getChartStyle()
Gets the value of the ChartStyle property. |
com.klg.jclass.chart.JCChartStyle |
getChartStyle(int index)
Gets the value of the ChartStyle property. |
int |
getChartType()
Gets the ChartType property of the ChartData
object, which determines how the chart data is plotted. |
com.klg.jclass.util.ImageMapInfo[] |
getClusterImageMapInfo()
Retrieves an array of image map information, one for each point cluster. |
com.klg.jclass.chart.JCDrawableColorHandler |
getColorHandler()
Gets the values of the ColorHandler property. |
protected com.klg.jclass.chart.DataHandler |
getDataHandler()
Gets the current DataHandler object. |
com.klg.jclass.chart.ChartDataModel |
getDataSource()
Gets the DataSource property for ChartDataView . |
boolean |
getDrawFrontPlane()
Gets the DrawFrontPlane property. |
int |
getDrawingOrder()
Gets the DrawingOrder property. |
com.klg.jclass.chart.JCChartTypeFormat |
getExistingChartFormat(int type)
Gets the Format class for the specified chart type if it exists. |
boolean |
getFastUpdate()
Gets the FastUpdate property. |
Point |
getFirstLast()
Calculates the set of points to be covered by a bar chart by finding the largest FirstPoint value and the smallest
LastPoint value. |
protected static int[] |
getFirstLastPoints(com.klg.jclass.chart.ChartDataView dv)
Used for Radar charts. |
double |
getHoleValue()
Returns the hole value for the chart data. |
com.klg.jclass.util.ImageMapInfo |
getImageMapInfo()
Retrieve the image map information for this ChartDataView . |
Locale |
getLocale()
Retrieve the local for this axis. |
String |
getName()
Gets the Name property of the ChartData object. |
int |
getNumPointLabels()
Gets the number of point labels set on this view. |
int |
getNumSeries()
Gets the value of the NumSeries parameter, which determines
how many data series there are in a ChartDataView . |
int |
getNumSeriesPerData()
Returns the number of actual series that comprise one item to be drawn. |
int |
getOutlineCap()
Gets the cap attribute of the outline around a filled chart item (for example, bar, pie). |
Color |
getOutlineColor()
Gets the value of the OutlineColor property. |
int |
getOutlineJoin()
Gets the join attribute of the outline around a filled chart item (for example, bar, pie). |
int |
getOutlinePattern()
Gets the pattern of the outline around a filled chart item (for example, bar, pie). |
com.klg.jclass.chart.JCLineStyle |
getOutlineStyle()
Gets the OutlineStyle property. |
int |
getOutlineWidth()
Gets the width of the outline around a filled chart item (for example, bar, pie). |
com.klg.jclass.util.io.OutputDataProperties |
getOutputDataProperties()
Get the current object which holds the output properties for writing data to a file and to html/xml properties. |
com.klg.jclass.chart.JCChart |
getParent()
Gets the JCChart object with which a ChartDataView
instance is associated. |
int |
getPickFocus()
Gets the PickFocus property of the data view. |
String |
getPointLabel(int index)
Gets a particular PointLabel from the PointLabels
property. |
List |
getPointLabels()
Gets the PointLabels property for the ChartDataView
object. |
List |
getSeries()
Gets the value of the Series property for this
ChartDataView instance. |
com.klg.jclass.chart.ChartDataViewSeries |
getSeries(int index)
Gets the value of the Series property at a particular index. |
int |
getSeriesIndex(com.klg.jclass.chart.ChartDataViewSeries srs)
A convenience method to retrieve a data series index given data series itself. |
int |
getSeriesIndex(String name)
A convenience method to retrieve a data series index given the name of the data series. |
int |
getVisibleDataSeries()
Returns the number of children data series that are marked as visible. |
double[] |
getXArrayCopy()
Gets a copy of the X values array currently used by this data view. |
com.klg.jclass.chart.JCAxis |
getXAxis()
Gets the value of the XAxis property. |
com.klg.jclass.chart.MinMax |
getXLimits()
Gets the the min and max X values in this data view. |
com.klg.jclass.chart.JCAxis |
getYAxis()
Gets the value of the YAxis property. |
com.klg.jclass.chart.MinMax |
getYLimits()
Gets the the min and max Y values in this data view. |
boolean |
hasVisibleInLegendChanged()
Internal Use Only. |
boolean |
is3DChartType()
Determines if chart type of this view is a 3D type. |
boolean |
isArrayData()
This method returns true if the ChartDataView contains array data. |
boolean |
isBatched()
Gets the Batched property. |
boolean |
isChanged()
Determines if view has been marked as changed. |
boolean |
isChanged(int mask)
Determines if view has been marked for a particular type of change. |
boolean |
isInverted()
Sets the Inverted property of the data view. |
boolean |
isUsingDoublePixels()
|
boolean |
isVisible()
Gets whether the data view is showing or not. |
boolean |
isVisibleInLegend()
Gets the VisibleInLegend property. |
com.klg.jclass.chart.JCDataCoord |
map(int x,
int y)
Performs a map operation by mapping the provided screen pixel information to data values along the x and y axes of the ChartDataView instance. |
void |
outputData(OutputStream stream)
Saves the raw Data to the given output stream. |
void |
removeSeries(int index)
Removes a single data series from the Series property of
the ChartDataView instance. |
void |
setAutoLabel(boolean auto)
Sets the AutoLabel property, which determines if a chart
automatically generates labels for each point in each series. |
void |
setBatched(boolean isBatched)
Sets the Batched property. |
void |
setBufferPlotData(boolean buffer)
Sets the BufferPlotData property. |
protected void |
setChanged(boolean b)
Convenience method used to set the changed state without update. |
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 |
setChartStyle(int index,
com.klg.jclass.chart.JCChartStyle value)
Sets the value of the ChartStyle property. |
void |
setChartStyle(List cs)
Sets the value of the ChartStyle property. |
void |
setChartType(int tp)
Sets the ChartType property of the ChartData
object, which specifies the type of chart used to plot the data. |
void |
setClusterImageMapInfo(com.klg.jclass.util.ImageMapInfo[] clusterImageMapInfo)
Sets an array of image map information, one for each point cluster. |
void |
setColorHandler(com.klg.jclass.chart.JCDrawableColorHandler dch)
Sets the values of the ColorHandler property. |
void |
setDataSource(com.klg.jclass.chart.ChartDataModel src)
Sets the data source for this ChartDataView . |
void |
setDrawFrontPlane(boolean front)
Gets the DrawFrontPlane property. |
void |
setDrawingOrder(int neword)
Sets the DrawingOrder property of the ChartDataView
object. |
void |
setFastUpdate(boolean fast)
Sets the FastUpdate property. |
void |
setHoleValue(double val)
Sets the hole value for the chart data. |
void |
setImageMapInfo(com.klg.jclass.util.ImageMapInfo imageMapInfo)
Set the image map information for this ChartDataView . |
void |
setInverted(boolean inv)
Sets the Inverted property of the data view. |
void |
setLocale(Locale locale)
Set the locale for this axis. |
void |
setName(String nm)
Sets the Name property of the ChartData object. |
void |
setOutlineCap(int cap)
Sets the cap attribute of the outline around a filled chart item (for example, bar, pie). |
void |
setOutlineColor(Color c)
Sets the value of the OutlineColor property. |
void |
setOutlineJoin(int join)
Sets the join attribute of the outline around a filled chart item (for example, bar, pie). |
void |
setOutlinePattern(int pattern)
Sets the pattern of the outline around a filled chart item (for example, bar, pie). |
void |
setOutlineStyle(com.klg.jclass.chart.JCLineStyle lineStyle)
Sets the OutlineStyle property. |
void |
setOutlineWidth(int width)
Sets the width of the outline around a filled chart item (for example, bar, pie). |
void |
setOutputDataProperties(com.klg.jclass.util.io.OutputDataProperties outputDataProperties)
Set the current object which holds the output properties for writing data to a file and to html/xml properties. |
void |
setParent(com.klg.jclass.chart.JCChart parent)
Sets the JCChart object with which a ChartDataView
instance is associated. |
void |
setPickFocus(int foc)
Sets the PickFocus property of the data view, which specifies
how distance is determined for pick operations. |
void |
setPointLabel(int index,
String label)
Sets a particular PointLabel from the PointLabels
property. |
void |
setPointLabels(List labels)
Sets the PointLabels property for the ChartDataView
object. |
void |
setSeries(int index,
com.klg.jclass.chart.ChartDataViewSeries s)
Sets the value of the Series property at a particular index. |
void |
setSeries(List newseries)
Sets the value of the Series property for this
ChartDataView instance. |
void |
setVisible(boolean showing)
Sets whether the dataview is showing or not. |
void |
setVisibleInLegend(boolean shn)
Sets the VisibleInLegend property. |
void |
setVisibleInLegendChanged(boolean changed)
Internal Use Only. |
void |
setXAxis(com.klg.jclass.chart.JCAxis ax)
Sets the value of the XAxis property. |
void |
setYAxis(com.klg.jclass.chart.JCAxis ax)
Sets the value of the YAxis property. |
String |
toString()
Output routine used for debugging. |
Point |
unmap(double xval,
double yval)
Performs an unmap operation by taking floating-point x and y values meant to represent a point along the x and y axes of the data. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Vector series
public static final int PICK_FOCUS_LOCAL
public static final int PICK_FOCUS_XY
public static final int PICK_FOCUS_X
public static final int PICK_FOCUS_Y
public static final String ERRMSG_INVALID_SERIES_INDEX
protected boolean batched
protected boolean fastUpdate
protected boolean bufferPlotData
protected double holeValue
protected int chartType
protected String name
protected int drawingOrder
protected boolean drawFrontPlane
protected com.klg.jclass.chart.ChartDataModel dataSource
protected com.klg.jclass.chart.JCAxis xaxis
protected com.klg.jclass.chart.JCAxis yaxis
protected List pointLabels
protected com.klg.jclass.util.ImageMapInfo[] clusterImageMapInfo
protected com.klg.jclass.util.ImageMapInfo imageMapInfo
protected boolean inverted
protected int pickFocus
protected boolean visibleInLegend
protected boolean visibleInLegendChanged
protected boolean autoLabel
protected com.klg.jclass.chart.JCLineStyle outlineStyle
protected com.klg.jclass.chart.JCDrawableColorHandler colorHandler
protected com.klg.jclass.util.io.OutputDataProperties outputDataProperties
protected transient com.klg.jclass.chart.DataHandler dataHandler
protected boolean visible
protected boolean changed
protected int changedFlag
protected boolean allowPick
protected double step
protected com.klg.jclass.chart.JCChart chart
protected com.klg.jclass.chart.MinMax xLimits
protected com.klg.jclass.chart.MinMax yLimits
protected Locale locale
public static final String[] format_class_names
JCChart
.
protected Hashtable formatClassHashtable
protected static int dataViewNum
Constructor Detail |
public ChartDataView()
PLOT
. Default name generated.
Method Detail |
public void setParent(com.klg.jclass.chart.JCChart parent)
JCChart
object with which a ChartDataView
instance is associated.
parent
- public com.klg.jclass.chart.JCChart getParent()
JCChart
object with which a ChartDataView
instance is associated.
JCChart
objectpublic void setLocale(Locale locale)
public Locale getLocale()
public void chartDataChange(com.klg.jclass.chart.ChartDataEvent evt)
ChartDataListener
interface.
This method will be called after chart data has changed.
chartDataChange
in interface ChartDataListener
evt
- the chart data event objectpublic boolean doFastUpdate(int column, int nPoints)
APPEND_DATA
event to chart when the FastUpdate
property of the view has been
turned on.
column
- column number of data array with new datanPoints
- Number of points added
true
if fast update drawn; false
otherwisepublic boolean checkNewPoints(int npoints)
npoints
- the number of points to check; it refers to the
number of points newly added to the end of all series
true
if all points sit inside the current axis bounds,
which are set to the default values; false
if any point sits
outside a current axis bound that is set to a default valuepublic double getHoleValue()
ChartData
places this value in the X and
Y arrays to represent a missing data value.
public void setHoleValue(double val)
ChartData
places this value in the x and
y arrays to represent a missing data value.
The hole value should not be set to Double.NAN
.
If the hole value is changed, previously designated hole values
will be drawn at their actual set value (that is, the old hole value).
If this old hole value is the default hole Double.MAX_VALUE
,
chart will experience severe drawing slowness, as it will be trying to scale
its values to such a great range. If you are using this method
to change hole values, it is suggested that you first change the previous
hole values inside the data to something realistic or to the new
hole value you are about to set.
val
- floating-point value used as a placeholder for missing
valuespublic boolean isBatched()
Batched
property. ChartData
is a model for
the ChartGroup
object. The Batched
property
controls whether the ChartGroup
is notified immediately of
ChartData
changes, or if the changes are accumulated and sent
at a later date.
isBatched
in interface Changeable
true
if changes are accumulated; false
otherwisepublic void setBatched(boolean isBatched)
Batched
property. ChartData
is a model for
the ChartGroup
object. The Batched
property
controls whether the ChartGroup
is notified immediately of
ChartData
changes, or if the changes are accumulated and sent at
a later date.
isBatched
- true
if changes are accumulated;
false
otherwisepublic boolean getFastUpdate()
FastUpdate
property. This property determines whether
column appends are done quickly, only recalculating and redrawing the new
data.
true
if column appends are done quicklypublic void setFastUpdate(boolean fast)
FastUpdate
property. This property determines whether
column appends are done quickly, only recalculating and redrawing the new
data.
fast
- true
if appends are to be done quicklypublic boolean getBufferPlotData()
BufferPlotData
property. This property determines
whether calculated plot data will be buffered to speed up drawing.
true
if buffering is to be performedpublic void setBufferPlotData(boolean buffer)
BufferPlotData
property. This property determines whether
calculated plot data will be buffered to speed up drawing.
buffer
- if buffering is to be performedpublic int getChartType()
ChartType
property of the ChartData
object, which determines how the chart data is plotted.
public void setChartType(int tp)
ChartType
property of the ChartData
object, which specifies the type of chart used to plot the data.
tp
- enumeration specifying the chart type; valid values are:
JCChart.AREA
, JCChart.AREA_RADAR
,
JCChart.BAR
, JCChart.CANDLE
,
JCChart.HILO
, JCChart.HILO_OPEN_CLOSE
,
JCChart.PIE
, JCChart.PLOT
,
JCChart.POLAR
, JCChart.RADAR
,
JCChart.SCATTER_PLOT
, JCChart.STACKING_AREA
,
and JCChart.STACKING_BAR
.
IllegalArgumentException
- If the new chart type is either
invalid or not currently supported.public String getName()
Name
property of the ChartData
object. The
Name
property is used as an index for referencing particular
ChartData
objects.
getName
in interface com.klg.jclass.util.JCName
ChartData
objectpublic void setName(String nm)
Name
property of the ChartData
object. The
Name
property is used as an index for referencing particular
ChartData
objects.
setName
in interface com.klg.jclass.util.JCName
nm
- name of the ChartData
objectpublic int getDrawingOrder()
DrawingOrder
property.
The DrawingOrder
property determines the drawing order of items.
When the DrawingOrder
property is changed, the order properties
of all ChartDataView
instances managed by a single
JCChart
object are normalized.
public void setDrawingOrder(int neword)
DrawingOrder
property of the ChartDataView
object. The DrawingOrder
property determines the drawing order
of items.
When the DrawingOrder
property is changed, the order properties
of all ChartDataView
instances managed by a single
JCChart
object are normalized.
neword
- new position of the ChartDataView
objectpublic boolean getDrawFrontPlane()
DrawFrontPlane
property. DrawFrontPlane
determines whether a data view that has both axes on the front plane of a 3d
graph will draw on the front or back plane of that graph. If
true
, it will draw on the front plane; if false
, it
will draw on the back plane. If either axis associated with the data view is
on the back plane, this property will be ignored and the data view will
automatically be drawn on the back plane. This property is also ignored for
3d chart types such as bar and stacking bar that automatically appear on the
front plane.
public void setDrawFrontPlane(boolean front)
DrawFrontPlane
property. DrawFrontPlane
determines whether a data view that has both axes on the front plane of a 3d
graph will draw on the front or back plane of that graph. If
true
, it will draw on the front plane; if false
, it
will draw on the back plane. If either axis associated with the data view is
on the back plane, this property will be ignored and the data view will
automatically be drawn on the back plane. This property is also ignored for
3d chart types such as bar and stacking bar that automatically appear on the
front plane.
front
- true
if trying to draw on front plane of 3d chart;
false
otherwisepublic com.klg.jclass.chart.ChartDataModel getDataSource()
DataSource
property for ChartDataView
.
This DataSource
property represents the class used to load data
into the ChartDataView
class. The DataSource
property holds this populating class if it implements either
EditableChartDataModel
or ChartDataManageable
. If
the DataSource
property is null, that means that the populating
data source class was discarded because it was no longer needed.
ChartDataView
;
this object implements either EditableChartDataModel
or
ChartDataManageable
public void setDataSource(com.klg.jclass.chart.ChartDataModel src)
ChartDataView
. The data source
class must implement either ChartDataModel
or
EditableChartDataModel
. JClass Chart will do the
correct operation based on the object provided.
If this data source class implements ChartDataManageable
,
this data view will be registered as a listener for data changes.
The data source class will be saved in the DataSource
property
for future reference if it implements either
ChartDataManageable
or EditableChartDataModel
.
Otherwise, since it is only needed to load data once,
the DataSource
property will be set to null.
src
- object acting as a data source for ChartDataView
;
this object must implement either ChartDataModel
or
EditableChartDataModel
public String getPointLabel(int index)
PointLabel
from the PointLabels
property. The PointLabels
property is an indexed property
consisting of a series of Strings representing the desired label for a
particular data point.
index
- index of the desired point
IllegalArgumentException
- If the point label index does
not address a valid point label.public void setPointLabel(int index, String label)
PointLabel
from the PointLabels
property. The PointLabels
property is an indexed property
consisting of a series of Strings representing the desired label for a
particular data point.
index
- index of the desired pointlabel
- String representing the requested point label
IllegalArgumentException
- If the point label index does
not address a valid point label.public List getPointLabels()
PointLabels
property for the ChartDataView
object. The PointLabels
property is an indexed property
consisting of a series of Strings representing the desired label for a
particular data point.
public int getNumPointLabels()
public void setPointLabels(List labels)
PointLabels
property for the ChartDataView
object. The PointLabels
property is an indexed property
consisting of a series of Strings representing the desired label for a
particular data point.
labels
- collection of String objects representing the point labelspublic com.klg.jclass.util.ImageMapInfo[] getClusterImageMapInfo()
public void setClusterImageMapInfo(com.klg.jclass.util.ImageMapInfo[] clusterImageMapInfo)
clusterImageMapInfo
- The new cluster image map information array.public com.klg.jclass.util.ImageMapInfo getImageMapInfo()
ChartDataView
. This
object is used to store the legend title image map information.
public void setImageMapInfo(com.klg.jclass.util.ImageMapInfo imageMapInfo)
ChartDataView
. This
object is used to store the legend title image map information.
imageMapInfo
- The new image map information.public List getSeries()
Series
property for this
ChartDataView
instance. The Series
property is an
indexed property that contains all data series for a particular
ChartDataView
. The order of ChartDataViewSeries
objects in the series array corresponds to the drawing order.
ChartDataViewSeries
instances
representing the requested data seriespublic com.klg.jclass.chart.ChartDataViewSeries getSeries(int index)
Series
property at a particular index.
The Series
property is an indexed property that
contains all data series for a particular ChartDataView
.
The order of ChartDataViewSeries
objects in the
Series
array corresponds to the drawing order.
index
- index of the data series to retrieve
Series
property at a particular index
IllegalArgumentException
- If the provided index does
not address an existing ChartDataViewSeries.public void setSeries(List newseries)
Series
property for this
ChartDataView
instance. The Series
property is an
indexed property that contains all data series for a particular
ChartDataView
. The order of ChartDataViewSeries
objects in the Series
array corresponds to the drawing order.
newseries
- list object containing ChartDataViewSeries
instances in the desired drawing order; the existing
series property will be replacedpublic void setSeries(int index, com.klg.jclass.chart.ChartDataViewSeries s)
Series
property at a particular index.
The Series
property is an indexed property that
contains all data series for a particular ChartDataView
.
The order of ChartDataViewSeries
objects in the
Series
array corresponds to the drawing order.
index
- index of the data series to retrieves
-
IllegalArgumentException
- If the provided index does
not address an existing ChartDataViewSeries.public com.klg.jclass.chart.ChartDataViewSeries addSeries(int index)
Series
property at the specified
index. addSeries()
creates a new
ChartDataViewSeries
instance and adds it to the
ChartDataView
instance at the requested position if possible.
index
- desired position of the new data series
ChartDataViewSeries
instance representing
the new data seriespublic void addSeries(com.klg.jclass.chart.ChartDataViewSeries s)
ChartDataViewSeries
to the view at the end of
the list.
s
- public void removeSeries(int index)
Series
property of
the ChartDataView
instance. Once the item is removed, the
order properties for each ChartDataViewSeries
are normalized
so that they correspond exactly to their index in the series
array.
index
- position of the ChartDataViewSeries
instance
that is to be removed
IllegalArgumentException
- If the index does not address
a valid ChartDataViewSeries
.public int getSeriesIndex(String name)
name
- name of the ChartDataViewSeries
instance
public int getSeriesIndex(com.klg.jclass.chart.ChartDataViewSeries srs)
srs
- the ChartDataViewSeries
instance
public com.klg.jclass.chart.JCChartTypeFormat getChartFormat()
Format
class for the current chart type. If the
current chart type should have a format class but has not been created yet,
one will be created and returned.
Format
class for the current chart type; one of
JCAreaChartFormat
, JCBarChartFormat
,
JCCandleChartFormat
, JCHLOCChartFormat
,
JCHiloChartFormat
, JCPieChartFormat
, or
JCPolarRadarChartFormat
depending on the chart type, or null
if the current chart type
should not have a format classpublic com.klg.jclass.chart.JCChartTypeFormat getChartFormat(int type)
Format
class for the specified chart type. If the
specified chart type should have a format class but has not been created yet,
one will be created and returned.
type
- the chart type
Format
class for the specified chart type; one of
JCAreaChartFormat
, JCBarChartFormat
,
JCCandleChartFormat
, JCHLOCChartFormat
,
JCHiloChartFormat
, JCPieChartFormat
, or
JCPolarRadarChartFormat
depending on the chart type, or null
if the specified chart type
should not have a format classpublic com.klg.jclass.chart.JCChartTypeFormat getExistingChartFormat(int type)
Format
class for the specified chart type if it exists.
Does not create a new format class if it doesn't exist.
type
- the chart type
Format
class for the specified chart type; one of
JCAreaChartFormat
, JCBarChartFormat
,
JCCandleChartFormat
, JCHLOCChartFormat
,
JCHiloChartFormat
, JCPieChartFormat
, or
JCPolarRadarChartFormat
depending on the chart type, or null
if the specified chart type
should not have a format classpublic com.klg.jclass.chart.JCAxis getXAxis()
XAxis
property. The XAxis
property determines the x axis against which the data in
ChartDataView
is plotted.
JCAxis
object representing the x axis for the
datapublic void setXAxis(com.klg.jclass.chart.JCAxis ax)
XAxis
property. The XAxis
property determines the x axis against which the data in
ChartDataView
is plotted.
ax
- JCAxis
object representing the x axis for the
datapublic com.klg.jclass.chart.JCAxis getYAxis()
YAxis
property. The YAxis
property determines the y axis against which the data in
ChartDataView is plotted.
JCAxis
object representing the y axis for the
datapublic void setYAxis(com.klg.jclass.chart.JCAxis ax)
YAxis
property. The YAxis
property determines the y axis against which the data in
ChartDataView is plotted.
ax
- JCAxis
object representing the y axis for
the datapublic com.klg.jclass.chart.JCDataCoord map(int x, int y)
ChartDataView
instance.
x
- X value in screen pixelsy
- Y value in screen pixels
JCDataCoord
instanceJCDataCoord
public Point unmap(double xval, double yval)
xval
- floating-point x valueyval
- floating-point y value
public com.klg.jclass.chart.JCDataCoord coordToDataCoord(int x, int y)
map()
. Converts pixel coordinates to data coordinates.
x
- X value in screen pixelsy
- Y value in screen pixels
JCDataCoord
instanceJCDataCoord
public Point dataCoordToCoord(double xval, double yval)
unmap()
. Converts data coordinates to pixel
coordinates.
xval
- floating-point x valueyval
- floating-point y value
public Point dataIndexToCoord(com.klg.jclass.chart.JCDataIndex di)
unpick()
for a specific data view. Converts a
JCDataIndex
instance (containing a data view, series, point) to
pixel values relative to the Chart component.
di
- JCDataIndex
instance containing data view, series, and
point
public com.klg.jclass.chart.JCDataIndex coordToDataIndex(int x, int y, int focus)
pick()
for a specific data view. Converts pixel
values relative to the Chart component to a JCDataIndex
instance
containing the data series and point closest to that location.
x
- X value of screen positiony
- Y value of screen positionfocus
- pick focus value used to determine distance between point
and the data drawn by the chart; if equal to
ChartDataView.PICK_FOCUS_LOCAL
, the pickFocus
property of the ChartDataView
will be used
JCDataIndex
instance containing data view, series, and
pointpublic boolean is3DChartType()
true
if the chart type of this view is either
BAR
or STACKING_BAR
public int getNumSeries()
NumSeries
parameter, which determines
how many data series there are in a ChartDataView
. Used in
conjunction with getSeries(int index)
to retrieve data series.
ChartDataView
public String toString()
toString
in class Object
public com.klg.jclass.chart.MinMax getXLimits()
public com.klg.jclass.chart.MinMax getYLimits()
public boolean isChanged()
isChanged
in interface Changeable
true
if view has been marked as changedpublic boolean isChanged(int mask)
isChanged
in interface Changeable
mask
- the type of change to check for; see Changeable for
a list of masks
true
if view has been marked as changedpublic boolean getChanged()
Changed
property.
getChanged
in interface Changeable
Changed
propertypublic boolean getChanged(int mask)
ChangedFlag
property.
getChanged
in interface Changeable
mask
- the type of change to check for; see Changeable for
a list of masks
protected void setChanged(boolean b)
b
- public 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
b
- cf
- public void setChanged(boolean b, int cf, boolean updateParent)
Changed
property, with option to
prevent parent updating via the updateParent
parameter.
updateParent
is independent of Batched
setChanged
in interface Changeable
b
- cf
- updateParent
- public Point getFirstLast()
FirstPoint
value and the smallest
LastPoint
value. Both values will be tempered by the
smallest array of points.
public int getVisibleDataSeries()
public void calcTransientData()
public void setInverted(boolean inv)
Inverted
property of the data view. If the
Inverted
property is set, the X-axis becomes vertical,
and the Y-axis becomes horizontal.
inv
- true
if the data is to be inverted;
false
otherwisepublic boolean isInverted()
Inverted
property of the data view. If the
Inverted
property is set, the X-axis becomes vertical,
and the Y-axis becomes horizontal.
true
if the data is to be inverted; false
otherwisepublic void setPickFocus(int foc)
PickFocus
property of the data view, which specifies
how distance is determined for pick operations. When set to
PICK_FOCUS_XY
, a pick operation will use the actual distance
between the point and the drawn data. When set to values of
PICK_FOCUS_X
or PICK_FOCUS_Y
, the distance only
along the X- or Y-axis is used.
foc
- the value to set the pick focus topublic int getPickFocus()
PickFocus
property of the data view. Possible values
are PICK_FOCUS_XY
, PICK_FOCUS_X
, and
PICK_FOCUS_Y
.
PickFocus
propertypublic boolean isVisibleInLegend()
VisibleInLegend
property. This property determines
whether or not the view name and its series will appear in the chart legend.
true
if the name will appear in the legendpublic void setVisibleInLegend(boolean shn)
VisibleInLegend
property. This property determines
whether or not the view name and its series will appear in the chart legend.
shn
- public boolean hasVisibleInLegendChanged()
public void setVisibleInLegendChanged(boolean changed)
public boolean getAutoLabel()
AutoLabel
property, which determines if a chart
automatically generates labels for each point in each series. The default is
false
. The labels are stored in the AutoLabelList
property. They are created using the Label
property of each
series.
AutoLabel
propertypublic void setAutoLabel(boolean auto)
AutoLabel
property, which determines if a chart
automatically generates labels for each point in each series. The labels
are stored in the AutoLabelList
property. They are created
using the Label
property of each series.
auto
- the value to set the AutoLabel
property topublic Color getOutlineColor()
OutlineColor
property. The
OutlineColor
property determines the color with which to draw
the outline around a filled chart item (for example, bar, pie).
public void setOutlineColor(Color c)
OutlineColor
property. The
OutlineColor
property determines the color with which to draw
the outline around a filled chart item (for example, bar, pie).
c
- the color to draw the outline inpublic int getOutlineWidth()
public void setOutlineWidth(int width)
width
- pixel width of the outlinepublic int getOutlinePattern()
JCLineStyle.NONE
, JCLineStyle.SOLID
,
JCLineStyle.LONG_DASH
, JCLineStyle.SHORT_DASH
,
JCLineStyle.LSL_DASH
, or JCLineStyle.DASH_DOT
public void setOutlinePattern(int pattern)
pattern
- one of JCLineStyle.NONE
,
JCLineStyle.SOLID
, JCLineStyle.LONG_DASH
,
JCLineStyle.SHORT_DASH
, JCLineStyle.LSL_DASH
, or
JCLineStyle.DASH_DOT
public int getOutlineJoin()
BasicStroke.JOIN_MITER
,
BasicStroke.JOIN_BEVEL
, or BasicStroke.JOIN_ROUND
public void setOutlineJoin(int join)
join
- one of BasicStroke.JOIN_MITER
,
BasicStroke.JOIN_BEVEL
, or BasicStroke.JOIN_ROUND
public int getOutlineCap()
BasicStroke.CAP_BUTT
,
BasicStroke.CAP_ROUND
, or BasicStroke.CAP_SQUARE
public void setOutlineCap(int cap)
cap
- one of BasicStroke.CAP_BUTT
,
BasicStroke.CAP_ROUND
, or BasicStroke.CAP_SQUARE
public com.klg.jclass.chart.JCLineStyle getOutlineStyle()
OutlineStyle
property. The OutlineStyle
property determines the color, width, and pattern (SOLID
,
LONG_DASH
, DASH_DOT
, etc.) of an outline around a
filled chart item (for example, bar, pie).
JCLineStyle
objectpublic void setOutlineStyle(com.klg.jclass.chart.JCLineStyle lineStyle)
OutlineStyle
property. The OutlineStyle
property determines the color, width, and pattern (SOLID
,
LONG_DASH
, DASH_DOT
, etc.) of an outline around a
filled chart item (for example, bar, pie).
lineStyle
- a JCLineStyle
objectpublic void setChartStyle(int index, com.klg.jclass.chart.JCChartStyle value)
ChartStyle
property.
The ChartStyle
property contains all the
ChartStyles
for the data series in this data view.
index
- index of the ChartStyle
to setvalue
- public com.klg.jclass.chart.JCChartStyle getChartStyle(int index)
ChartStyle
property. The
ChartStyle
property contains all of the ChartStyles
for the data series in this data view.
index
- index of the ChartStyle
to retrieve
ChartStyle
at the specified indexpublic List getChartStyle()
ChartStyle
property.
The ChartStyle
property contains all the
ChartStyles
for the data series in this data view.
JCChartStyle
instances used for
this data viewpublic void setChartStyle(List cs)
ChartStyle
property.
The ChartStyle
property contains all the
ChartStyles
for the data series in this data view.
cs
- List object containing JCChartStyle
instances used
for this data viewpublic void setColorHandler(com.klg.jclass.chart.JCDrawableColorHandler dch)
ColorHandler
property.
The ColorHandler
property references a class that implements the
JCDrawableColorHandler
interface to override the default color
for drawing chart data. Currently, the color handler is only used
by Plot charts. A null value for this property indicates that
the default series color is to be used.
dch
- a class implementing the JCDrawableColorHandler
interfacepublic com.klg.jclass.chart.JCDrawableColorHandler getColorHandler()
ColorHandler
property.
The ColorHandler
property references a class that implements the
JCDrawableColorHandler
interface to override the default color
for drawing chart data. Currently, the color handler is only used
by Plot charts. A null value for this property indicates that
the default series color is to be used.
JCDrawableColorHandler
interface, or nullpublic com.klg.jclass.util.io.OutputDataProperties getOutputDataProperties()
public void setOutputDataProperties(com.klg.jclass.util.io.OutputDataProperties outputDataProperties)
outputDataProperties
- The new ata output properties objectpublic double[] getXArrayCopy()
public boolean isArrayData()
public int getNumSeriesPerData()
public void setVisible(boolean showing)
VisibleInLegend
to the same
value. If you wish VisibleInLegend
to have a different value,
please call setVisibleInLegend()
following
setVisible()
.
showing
- public boolean isVisible()
public void outputData(OutputStream stream)
InputStreamDataSource
.
stream
- the OutputStream
to write the data toprotected com.klg.jclass.chart.DataHandler getDataHandler()
DataHandler
object.
DataHandles
objectprotected static int[] getFirstLastPoints(com.klg.jclass.chart.ChartDataView dv)
firstPoint
and lowest value of lastPoint
.
If no error occurs, a two-element integer array is returned. The
first array element is the value of firstPoint
. The second
array element is the value of lastPoint
. If an error occurs,
null is returned.
dv
-
firstPoint
. The second
array element is the value of lastPoint
. If an error occurs,
null is returned.public boolean isUsingDoublePixels()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |