Package jadex.tools.comanalyzer.chart
Class GroupedCategoryDataset
- java.lang.Object
- 
- org.jfree.data.general.AbstractDataset
- 
- jadex.tools.comanalyzer.chart.GroupedCategoryDataset
 
 
- 
- All Implemented Interfaces:
- java.io.ObjectInputValidation,- java.io.Serializable,- java.lang.Cloneable,- java.util.EventListener,- org.jfree.data.category.CategoryDataset,- org.jfree.data.general.Dataset,- org.jfree.data.general.DatasetChangeListener,- org.jfree.data.KeyedValues2D,- org.jfree.data.Values2D
 
 public class GroupedCategoryDataset extends org.jfree.data.general.AbstractDataset implements org.jfree.data.category.CategoryDataset, org.jfree.data.general.DatasetChangeListener, java.io.SerializableThis class provides methods for automatic grouping of data for the GroupedStackedBarRenderer. This class acts as a dataset itselves, but retrievs the actual data from datasets, that can be added to in order to group data from the datasets with equal row keys.
 - See Also:
- Serialized Form
 - 
- 
Field SummaryFields Modifier and Type Field Description protected org.jfree.chart.axis.SubCategoryAxisaxisThe category axis for groupsprotected java.util.MapdatasetsThe datasets for the Groupprotected java.util.MapkeyToDatasetThe map with group rowkeys and datasets for easy and fast access to the original datasetsprotected java.util.ListkeyToGroupThe list of assigned groupsprotected org.jfree.data.KeyToGroupMapkeytogroupmapThe map for assigning series to groupsprotected java.util.MapkeyToRowKeyThe map with group rowkeys and original rowkeys for easy and fast access to the original datasetsprotected org.jfree.chart.renderer.category.GroupedStackedBarRendererrendererThe bar renderer for groups.
 - 
Constructor SummaryConstructors Constructor Description GroupedCategoryDataset()Creates an initial dataset.GroupedCategoryDataset(org.jfree.chart.JFreeChart chart)Creates a dataset and retrieves the GroupedStackedBarRenderer and the SubCategoryAxis from the chart.GroupedCategoryDataset(org.jfree.chart.renderer.category.GroupedStackedBarRenderer renderer, org.jfree.chart.axis.SubCategoryAxis axis)Creates a dataset, that is linked to a GroupedStackedBarRenderer for assigne the groupmaps and to the SubCategoryAxis to create subcategories.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCategoryDataset(org.jfree.data.category.CategoryDataset dataset, java.lang.String name)Adds a dataset and (if the dataset is not empty) assigning groups for each rowkey to the renderer and adding subcategories to the axis.voidcleanup()Removes all references to assigned objects.voiddatasetChanged(org.jfree.data.general.DatasetChangeEvent event)A dataset has changed.intgetColumnCount()Returns the total number of different columns in the datasets.intgetColumnIndex(java.lang.Comparable key)Returns the column index for a given key.java.lang.ComparablegetColumnKey(int column)Returns a column key.java.util.ListgetColumnKeys()Returns the column keys.java.util.ListgetList(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the List for a given group rowkey and column key.java.lang.ComparablegetOriginalRowKey(java.lang.Comparable rowKey)Returns the original rowkey from a group rowkeyintgetRowCount()Returns the total number of all rows in the datasets.intgetRowIndex(java.lang.Comparable key)Returns the row index for a given key.java.lang.ComparablegetRowKey(int row)Returns a row key.java.util.ListgetRowKeys()Returns the row keys.java.lang.NumbergetValue(int row, int column)Returns a value from the table.java.lang.NumbergetValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for a pair of keys.- 
Methods inherited from class org.jfree.data.general.AbstractDatasetaddChangeListener, clone, fireDatasetChanged, getGroup, hasListener, notifyListeners, removeChangeListener, setGroup, validateObject
 
- 
 
- 
 - 
- 
Field Detail- 
datasetsprotected java.util.Map datasets The datasets for the Group
 - 
axisprotected org.jfree.chart.axis.SubCategoryAxis axis The category axis for groups
 - 
rendererprotected org.jfree.chart.renderer.category.GroupedStackedBarRenderer renderer The bar renderer for groups.
 - 
keytogroupmapprotected org.jfree.data.KeyToGroupMap keytogroupmap The map for assigning series to groups
 - 
keyToGroupprotected java.util.List keyToGroup The list of assigned groups
 - 
keyToRowKeyprotected java.util.Map keyToRowKey The map with group rowkeys and original rowkeys for easy and fast access to the original datasets
 - 
keyToDatasetprotected java.util.Map keyToDataset The map with group rowkeys and datasets for easy and fast access to the original datasets
 
- 
 - 
Constructor Detail- 
GroupedCategoryDatasetpublic GroupedCategoryDataset() Creates an initial dataset.
 - 
GroupedCategoryDatasetpublic GroupedCategoryDataset(org.jfree.chart.renderer.category.GroupedStackedBarRenderer renderer, org.jfree.chart.axis.SubCategoryAxis axis)Creates a dataset, that is linked to a GroupedStackedBarRenderer for assigne the groupmaps and to the SubCategoryAxis to create subcategories.- Parameters:
- renderer- The GroupedStackedBarRenderer.
- axis- The SubCategoryAxis.
 
 - 
GroupedCategoryDatasetpublic GroupedCategoryDataset(org.jfree.chart.JFreeChart chart) Creates a dataset and retrieves the GroupedStackedBarRenderer and the SubCategoryAxis from the chart.- Parameters:
- chart-
 
 
- 
 - 
Method Detail- 
addCategoryDatasetpublic void addCategoryDataset(org.jfree.data.category.CategoryDataset dataset, java.lang.String name)Adds a dataset and (if the dataset is not empty) assigning groups for each rowkey to the renderer and adding subcategories to the axis.- Parameters:
- dataset- The dataset.
- name- The name for the dataset.
 
 - 
cleanuppublic void cleanup() Removes all references to assigned objects.
 - 
getRowCountpublic int getRowCount() Returns the total number of all rows in the datasets.- Specified by:
- getRowCountin interface- org.jfree.data.Values2D
- Returns:
- The row count.
 
 - 
getColumnCountpublic int getColumnCount() Returns the total number of different columns in the datasets.- Specified by:
- getColumnCountin interface- org.jfree.data.Values2D
- Returns:
- The column count.
 
 - 
getColumnKeyspublic java.util.List getColumnKeys() Returns the column keys.- Specified by:
- getColumnKeysin interface- org.jfree.data.KeyedValues2D
- Returns:
- The keys.
 
 - 
getRowKeyspublic java.util.List getRowKeys() Returns the row keys.- Specified by:
- getRowKeysin interface- org.jfree.data.KeyedValues2D
- Returns:
- The keys.
 
 - 
getRowIndexpublic int getRowIndex(java.lang.Comparable key) Returns the row index for a given key.- Specified by:
- getRowIndexin interface- org.jfree.data.KeyedValues2D
- Parameters:
- key- the row keys.
- Returns:
- The row index.
 
 - 
getColumnIndexpublic int getColumnIndex(java.lang.Comparable key) Returns the column index for a given key.- Specified by:
- getColumnIndexin interface- org.jfree.data.KeyedValues2D
- Parameters:
- key- the column key.
- Returns:
- The column index.
 
 - 
getRowKeypublic java.lang.Comparable getRowKey(int row) Returns a row key.- Specified by:
- getRowKeyin interface- org.jfree.data.KeyedValues2D
- Parameters:
- row- the row index (zero-based).
- Returns:
- The row key.
 
 - 
getColumnKeypublic java.lang.Comparable getColumnKey(int column) Returns a column key.- Specified by:
- getColumnKeyin interface- org.jfree.data.KeyedValues2D
- Parameters:
- column- the column index (zero-based).
- Returns:
- The column key.
 
 - 
getValuepublic java.lang.Number getValue(int row, int column)Returns a value from the table.- Specified by:
- getValuein interface- org.jfree.data.Values2D
- Parameters:
- row- the row index (zero-based).
- column- the column index (zero-based).
- Returns:
- The value (possibly null).
 
 - 
getValuepublic java.lang.Number getValue(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the value for a pair of keys.- Specified by:
- getValuein interface- org.jfree.data.KeyedValues2D
- Parameters:
- rowKey- the row key (- nullnot permitted).
- columnKey- the column key (- nullnot permitted).
- Returns:
- The value (possibly null).
 
 - 
datasetChangedpublic void datasetChanged(org.jfree.data.general.DatasetChangeEvent event) A dataset has changed. Assign all new rowkeys as groups to the renderer and delete no longer existing rowkeys from the maps.- Specified by:
- datasetChangedin interface- org.jfree.data.general.DatasetChangeListener
- Parameters:
- event- The event.
 
 - 
getListpublic java.util.List getList(java.lang.Comparable rowKey, java.lang.Comparable columnKey)Returns the List for a given group rowkey and column key. The proper dataset and original rowkey is retrieved from the maps.- Parameters:
- rowKey- The group rowkey.
- columnKey- The columnkey.
- Returns:
- The list.
 
 - 
getOriginalRowKeypublic java.lang.Comparable getOriginalRowKey(java.lang.Comparable rowKey) Returns the original rowkey from a group rowkey
 
- 
 
-