com.klg.jclass.chart3d.data
Class JCSwing3dDataSource
java.lang.Object
|
+--com.klg.jclass.chart3d.event.Chart3dDataSupport
|
+--com.klg.jclass.chart3d.data.Base3dDataSource
|
+--com.klg.jclass.chart3d.data.Base3dGridDataSource
|
+--com.klg.jclass.chart3d.data.JCDefault3dGridDataSource
|
+--com.klg.jclass.chart3d.data.JCEditable3dGridDataSource
|
+--com.klg.jclass.chart3d.data.JCSwing3dDataSource
- All Implemented Interfaces:
- Chart3dDataManager, Chart3dDataModel, Chart3dGridDataModel, Cloneable, EditableChart3dDataModel, EventListener, HoleValueChart3dDataModel, LabelledChart3dDataModel, LabelledChart3dGridDataModel, Serializable, TableModelListener
- public class JCSwing3dDataSource
- extends JCEditable3dGridDataSource
- implements TableModelListener
3d DataSource
converts a Swing TableModel
into a form useable
by the 3d Chart
. X and Y values are generated. ZValues are generated
in the form zValues[table columns][table rows].
Note: This DataSource
is only available in Grid format.
This datasource implements TableModelListener
for the benefit of those
who wish to update their chart through the TableModel
. It is
recommended that those who wish to update their TableModel
through the
chart should implement a Chart3dDataListener
for this purpose.
- See Also:
- Serialized Form
Field Summary |
protected TableModel |
tableModel
Swing TableModel instance used to provide zValues for this datasource. |
Methods inherited from class com.klg.jclass.chart3d.data.Base3dGridDataSource |
clone, getDataSourceName, getNumX, getNumY, getXGrid, getXLabels, getYGrid, getYLabels, getZValues, setDataSourceName, setXGrid, setXLabels, setYGrid, setYLabels, setZValues |
tableModel
protected TableModel tableModel
- Swing
TableModel
instance used to provide zValues for this datasource.
JCSwing3dDataSource
public JCSwing3dDataSource(TableModel tm)
- Simple constructor which takes the
TableModel
as an
argument.
- Parameters:
tm
- - See Also:
TableModel
setData
protected void setData()
- Makes zValues out of the
tableModel
. It is called by
the 1-arg constructor, the setTableModel
method, and anytime
changes to the tableModel
are comprehensive enough to warrant
a RESET
event (which it fires).
tableChanged
public void tableChanged(TableModelEvent ev)
- This method is from the
TableModelListener
. It updates the
chart data, when the TableModel
Changes.
- Specified by:
tableChanged
in interface TableModelListener
- Parameters:
ev
- TableModelEvent
getTableModel
public TableModel getTableModel()
- Gets the
TableModel
object for this datasource.
- Returns:
- tableModel
TableModel
setTableModel
public void setTableModel(TableModel tm)
- Sets the
tableModel
property, adds the tableModelListener
to
it, and calls setData;
.
- Parameters:
tm
-