Package com.illumon.iris.db.tables.utils
Class DBXYCategoryDataset
java.lang.Object
org.jfree.data.general.AbstractDataset
org.jfree.data.general.AbstractSeriesDataset
org.jfree.data.xy.AbstractXYDataset
com.illumon.iris.db.tables.utils.DBXYDataset
com.illumon.iris.db.tables.utils.DBXYCategoryDataset
- All Implemented Interfaces:
DBDataset
,ObjectInputValidation
,Serializable
,Cloneable
,EventListener
,org.jfree.data.general.Dataset
,org.jfree.data.general.SeriesChangeListener
,org.jfree.data.general.SeriesDataset
,org.jfree.data.xy.XYDataset
public class DBXYCategoryDataset extends DBXYDataset
An implementation of
DBXYDataset
that dynamically creates distinct series for different categories.
The categories are defined by the values of a DB table column.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DBXYCategoryDataset.XYPairAndCategory
AnXYPair
that also stores a category.Nested classes/interfaces inherited from class com.illumon.iris.db.tables.utils.DBXYDataset
DBXYDataset.XYPair
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DBXYCategoryDataset(ReplicatedTable localTable, String categoricalColumn)
DBXYCategoryDataset(String categoricalColumn)
-
Method Summary
Modifier and Type Method Description void
fireTableDataChanged()
Notifies this DBDataset that the data in the table used as its data source has changed, or that the entire source table itself has changed (such as withDBDataset.setLocalTable(ReplicatedTable)
.int
getCategoriesCount()
int
getItemCount(int series)
int
getSeriesCount()
Returns the number of series in this dataset.Comparable
getSeriesKey(int series)
Number
getX(int series, int item)
Number
getY(int series, int item)
void
setLocalTable(ReplicatedTable table)
Sets theDBXYDataset.localTable
that this dataset will use as its data source.Methods inherited from class org.jfree.data.xy.AbstractXYDataset
getDomainOrder, getXValue, getYValue
Methods inherited from class org.jfree.data.general.AbstractDataset
addChangeListener, clone, fireDatasetChanged, getGroup, getNotify, hasListener, notifyListeners, removeChangeListener, setGroup, setNotify, validateObject
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Method Details
-
setLocalTable
Description copied from class:DBXYDataset
Sets theDBXYDataset.localTable
that this dataset will use as its data source. Calling code should subsequently invokeDBXYDataset.fireTableDataChanged()
on the event dispatch thread.- Specified by:
setLocalTable
in interfaceDBDataset
- Overrides:
setLocalTable
in classDBXYDataset
- See Also:
DBDataset.setLocalTable(ReplicatedTable)
-
getSeriesCount
public int getSeriesCount()Returns the number of series in this dataset. This is the number of series defined for the chart times the number of categories- Specified by:
getSeriesCount
in interfaceorg.jfree.data.general.SeriesDataset
- Overrides:
getSeriesCount
in classDBXYDataset
- Returns:
-
getSeriesKey
- Specified by:
getSeriesKey
in interfaceorg.jfree.data.general.SeriesDataset
- Overrides:
getSeriesKey
in classDBXYDataset
-
getCategoriesCount
public int getCategoriesCount() -
getItemCount
public int getItemCount(int series)- Specified by:
getItemCount
in interfaceorg.jfree.data.xy.XYDataset
- Overrides:
getItemCount
in classDBXYDataset
-
getX
- Specified by:
getX
in interfaceorg.jfree.data.xy.XYDataset
- Overrides:
getX
in classDBXYDataset
-
getY
- Specified by:
getY
in interfaceorg.jfree.data.xy.XYDataset
- Overrides:
getY
in classDBXYDataset
-
fireTableDataChanged
public void fireTableDataChanged()Description copied from interface:DBDataset
Notifies this DBDataset that the data in the table used as its data source has changed, or that the entire source table itself has changed (such as withDBDataset.setLocalTable(ReplicatedTable)
.If an implementation of
fireTableDataChanged()
callsAbstractDataset.fireDatasetChanged()
, or otherwise interacts with JFreeChart, then this method should only be called on the event dispatch thread. (SeeSwingUtilities.invokeLater()
.)- Specified by:
fireTableDataChanged
in interfaceDBDataset
- Overrides:
fireTableDataChanged
in classDBXYDataset
-