JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.chart
Class JCDataIndex

java.lang.Object
  |
  +--com.klg.jclass.chart.JCDataIndex
All Implemented Interfaces:
Serializable

public class JCDataIndex
extends Object
implements Serializable

JCDataIndex contains a unique index to a data point in Chart, consisting of a data series instance and an index representing the point within the data series. It is used by the chart pick() methods, and also contains information related to these operations.

See Also:
Serialized Form

Field Summary
protected  com.klg.jclass.chart.ChartDataView dataView
          Data view value for the data point.
protected  int distance
          Distance value, used during pick.
protected  Object obj
          Chart object picked (for example, legend, chartArea).
protected  int point
          Index of the point within the data series.
protected  com.klg.jclass.chart.ChartDataViewSeries series
          Data series value for the data point.
protected  int seriesIndex
          Data series index for the data point.
 
Constructor Summary
JCDataIndex()
          Simple constructor for JCDataIndex.
JCDataIndex(com.klg.jclass.chart.ChartDataView dv, com.klg.jclass.chart.ChartDataViewSeries s, int i, int p)
          Constructor that creates a data index from the standard information needed to create a data index: a data view, a series instance, the index of that series instance, and a point index.
JCDataIndex(int p, com.klg.jclass.chart.ChartDataViewSeries s)
          Constructor that creates a data index from a series instance and a point index within that series.
 
Method Summary
 boolean equals(Object o)
          Determines if the specified object refers to the same data point as this JCDataIndex instance.
 com.klg.jclass.chart.ChartDataView getDataView()
          Gets the value of the DataView property.
 int getDistance()
          Gets the value of the Distance property.
 Object getObject()
          Gets the value of the Obj property.
 int getPoint()
          Gets the value of the Point property.
 com.klg.jclass.chart.ChartDataViewSeries getSeries()
          Gets the value of the Series property.
 int getSeriesIndex()
          Gets the value of the SeriesIndex property.
 int hashCode()
          Creates hash code, depending on the value of the data view hash code plus series index and point value.
 void setDataView(com.klg.jclass.chart.ChartDataView view)
          Sets the value of the DataView property.
 void setDistance(int dist)
          Sets the value of the Distance property.
 void setObject(Object object)
          Sets the value of the Obj property.
 void setPoint(int p)
          Gets the value of the Point property.
 void setSeries(com.klg.jclass.chart.ChartDataViewSeries s)
          Gets the value of the Series property.
 void setSeriesIndex(int index)
          Sets the value of the SeriesIndex property.
 String toString()
          Returns a string representation of this data index object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

obj

protected Object obj
Chart object picked (for example, legend, chartArea).


dataView

protected com.klg.jclass.chart.ChartDataView dataView
Data view value for the data point. Null if no series.


series

protected com.klg.jclass.chart.ChartDataViewSeries series
Data series value for the data point. Null if no series.


seriesIndex

protected int seriesIndex
Data series index for the data point. -1 if no series. Equal to JCPieChartFormat.OTHER_SLICE if the other slice in a pie chart has been picked.


point

protected int point
Index of the point within the data series. -1 if no selected point.


distance

protected int distance
Distance value, used during pick.

Constructor Detail

JCDataIndex

public JCDataIndex()
Simple constructor for JCDataIndex.


JCDataIndex

public JCDataIndex(int p,
                   com.klg.jclass.chart.ChartDataViewSeries s)
Constructor that creates a data index from a series instance and a point index within that series. It fills in the dataView and seriesIndex members bases on information from the series instance.

Parameters:
p - the point index within the series
s - the data series instance that holds the point

JCDataIndex

public JCDataIndex(com.klg.jclass.chart.ChartDataView dv,
                   com.klg.jclass.chart.ChartDataViewSeries s,
                   int i,
                   int p)
Constructor that creates a data index from the standard information needed to create a data index: a data view, a series instance, the index of that series instance, and a point index.

Parameters:
dv - the data view that holds the series and point
s - the data series instance that holds the point
i - index of the data series within the series list
p - the point index within the series
Method Detail

getSeries

public com.klg.jclass.chart.ChartDataViewSeries getSeries()
Gets the value of the Series property. It containts the ChartDataViewSeries instance that holds the point that this data index class is referring to.

Returns:
the data series instance

setSeries

public void setSeries(com.klg.jclass.chart.ChartDataViewSeries s)
Gets the value of the Series property. It containts the ChartDataViewSeries instance that holds the point that this data index class is referring to.

Parameters:
s - the data series instance

getDataView

public com.klg.jclass.chart.ChartDataView getDataView()
Gets the value of the DataView property. It contains the ChartDataView instance that holds the point that this data index class is referring to.

Returns:
the data view

setDataView

public void setDataView(com.klg.jclass.chart.ChartDataView view)
Sets the value of the DataView property. It contains the ChartDataView instance that holds the point that this data index class is referring to.

Parameters:
view - the data view

getSeriesIndex

public int getSeriesIndex()
Gets the value of the SeriesIndex property. It contains the index of the data series (specified in the Series property) that contains the point that this data index class is referring to. Alternately, it may be equal to JCPieChartFormat.OTHER_SLICE if this data index class is referring to the other slice of a pie chart.

Returns:
the series index

setSeriesIndex

public void setSeriesIndex(int index)
Sets the value of the SeriesIndex property. It contains the index of the data series (specified in the Series property) that contains the point that this data index class is referring to. Alternately, it may be equal to JCPieChartFormat.OTHER_SLICE if this data index class is referring to the other slice of a pie chart.

Parameters:
index - the series index

getPoint

public int getPoint()
Gets the value of the Point property. It contains the index of the point that this data index class refers to within the series (specified by the Series property).

Returns:
index of the selected point within the data series

setPoint

public void setPoint(int p)
Gets the value of the Point property. It contains the index of the point that this data index class refers to within the series (specified by the Series property).

Parameters:
p - index of the selected point within the data series

getDistance

public int getDistance()
Gets the value of the Distance property. It is used by pick operations and contains the distance between the point selected and the nearest data point.

Returns:
distance from the selected point

setDistance

public void setDistance(int dist)
Sets the value of the Distance property. It is used by pick operations and contains the distance between the point selected and the nearest data point.

Parameters:
dist - distance from the selected point

getObject

public Object getObject()
Gets the value of the Obj property. It is used by pick operations and contains the object picked (for example, JCChartArea or JCLegend instance) by those operations.

Returns:
picked object

setObject

public void setObject(Object object)
Sets the value of the Obj property. It is used by pick operations and contains the object picked (for example, JCChartArea or JCLegend instance) by those operations.

Parameters:
object - picked object

equals

public boolean equals(Object o)
Determines if the specified object refers to the same data point as this JCDataIndex instance.

Overrides:
equals in class Object
Parameters:
o - object to compare
Returns:
if the passed object is a JCDataIndex instance and refers to the same data point as this instance

hashCode

public int hashCode()
Creates hash code, depending on the value of the data view hash code plus series index and point value. This should generate the same hashCode for all equal JCDataIndex objects, and a different hashCode for inequal JCDataIndex objects.

Overrides:
hashCode in class Object
Returns:
A hash code value for this object.
See Also:
equals(java.lang.Object), Hashtable

toString

public String toString()
Returns a string representation of this data index object.

Overrides:
toString in class Object
Returns:
A string representation of this object.

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