org.progeeks.jfreechart
Class DefaultChartDataTransform
java.lang.Object
org.progeeks.util.beans.BeanChangeSupport
org.progeeks.jfreechart.DefaultChartDataTransform
- All Implemented Interfaces:
- ChartDataTransform, StandardBean
public class DefaultChartDataTransform
- extends BeanChangeSupport
- implements ChartDataTransform
- Version:
- $Revision: 1.4 $
- Author:
- esword
Method Summary |
java.lang.Object |
getChartDataItem(java.lang.Object keyData)
Checks that keyData is part of the List and returns it if so. |
java.util.List |
getDataList()
Generates or extracts list with the data objects used to produce a chart Dataset
from a stored data object. |
java.lang.Object |
getDataSource()
Retrieve the data source that is used. |
java.lang.Object |
getOriginalDataItem(java.lang.Object chartData)
The opposite of getChartDataItem , invoked with information from the chart. |
void |
releaseDataSource()
Clears internal references to dataSource |
Methods inherited from class org.progeeks.util.beans.BeanChangeSupport |
addPropertyChangeListener, addPropertyChangeListener, clearAllListeners, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, hasListeners, hasListeners, removePropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final Log log
dataSource
protected java.lang.Object dataSource
DefaultChartDataTransform
public DefaultChartDataTransform()
DefaultChartDataTransform
public DefaultChartDataTransform(java.lang.Object dataSource)
- Parameters:
dataSource
-
getDataList
public java.util.List getDataList()
- Description copied from interface:
ChartDataTransform
- Generates or extracts list with the data objects used to produce a chart
Dataset
from a stored data object.
- Specified by:
getDataList
in interface ChartDataTransform
- Returns:
- List with the data objects
releaseDataSource
public void releaseDataSource()
- Clears internal references to dataSource
- Specified by:
releaseDataSource
in interface ChartDataTransform
getOriginalDataItem
public java.lang.Object getOriginalDataItem(java.lang.Object chartData)
- Description copied from interface:
ChartDataTransform
- The opposite of
getChartDataItem
, invoked with information from the chart.
Attempts to return the original data object that is represented by the passed parameter.
Useful for when a user action on the chart needs to be broadcast outside of the chart context
in a form that other components can understand.
- Specified by:
getOriginalDataItem
in interface ChartDataTransform
- Parameters:
chartData
- If the List that was passed to the chart originally from
getDataList
contained the actual data from the DataSource, then
chartData
can just be returned directly. Otherwise,
chartData
should contain enough information for the transform to
know how to retrieve the original information. For example, chartData
may be a clone of the original object.
original data cannot be obtained.- See Also:
ChartDataTransform.getOriginalDataItem(java.lang.Object)
getChartDataItem
public java.lang.Object getChartDataItem(java.lang.Object keyData)
- Checks that
keyData
is part of the List and returns it if so. If not,
iterates over the list and uses the equals
method to see if keyData
matches an item that way.
- Specified by:
getChartDataItem
in interface ChartDataTransform
- Returns:
- Matching data from the data source.
- See Also:
ChartDataTransform.getChartDataItem(java.lang.Object)
getDataSource
public java.lang.Object getDataSource()
- Description copied from interface:
ChartDataTransform
- Retrieve the data source that is used. There is purposefully no
setDataSource
call
to make the property immutable. Once a Transform has been build and is creating data for a chart,
you don't want to remove the whole underlying data structure, largely because charts aren't good
at deleting data.
- Specified by:
getDataSource
in interface ChartDataTransform
- Returns:
- Returns the dataSource.
Copyright © 2002-2003 Paul Speed. All Rights Reserved.