schmitzm.jfree.feature
Class FeatureSeriesDatasetSelectionModel

java.lang.Object
  extended by schmitzm.jfree.chart.selection.AbstractDatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>
      extended by schmitzm.jfree.chart.selection.SeriesDatasetSelectionModel
          extended by schmitzm.jfree.feature.FeatureSeriesDatasetSelectionModel
All Implemented Interfaces:
DatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>, FeatureDatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>

public class FeatureSeriesDatasetSelectionModel
extends SeriesDatasetSelectionModel
implements FeatureDatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>

This class extends the SeriesDatasetSelectionModel with the FeatureDatasetSelectionModel, so that selection operations can directly applied on feature IDs.

Author:
Martin Schmitz

Field Summary
protected  Feature2SeriesDatasetMapping mapping
          Holds the mapping between features and the corresponding item indices of each series.
 
Fields inherited from class schmitzm.jfree.chart.selection.AbstractDatasetSelectionModel
dataset, listeners, LOGGER, selectedSeriesIdx
 
Constructor Summary
FeatureSeriesDatasetSelectionModel(SeriesDataset dataset)
          Creates a new selection model.
 
Method Summary
 boolean changeItemSelection(String fID)
          Changes the selection of the data item of a feature in all series.
 boolean changeItemSelection(String fID, Comparable<?> seriesKey)
          Changes the selection of the data item of a feature.
 Set<String> getSelectedFeatures()
          Returns the IDs of the selected features (in any series).
 boolean isFeatureSelected(String fID)
          Checks if the data item of a feature is selected in any series.
 boolean isFeatureSelected(String fID, Comparable<?> seriesKey)
          Checks if the data item of a feature is selected.
 void setItemSelected(String fID, boolean selected)
          Sets the selection state for a feature in all dataset series.
 void setItemSelected(String fID, Comparable<?> seriesKey, boolean selected)
          Sets whether the data item of a feature is selected or not.
 
Methods inherited from class schmitzm.jfree.chart.selection.SeriesDatasetSelectionModel
datasetChanged
 
Methods inherited from class schmitzm.jfree.chart.selection.AbstractDatasetSelectionModel
addSelectionListener, changeItemSelection, clearSelection, createInstanceFor, createSelectionChangeEvent, getDataset, getValueIsAdjusting, isItemSelected, refreshSelection, removeSelectionListener, setItemSelected, setValueIsAdjusting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface schmitzm.jfree.chart.selection.DatasetSelectionModel
addSelectionListener, changeItemSelection, clearSelection, datasetChanged, getDataset, getValueIsAdjusting, isItemSelected, refreshSelection, removeSelectionListener, setItemSelected, setValueIsAdjusting
 

Field Detail

mapping

protected Feature2SeriesDatasetMapping mapping
Holds the mapping between features and the corresponding item indices of each series.

Constructor Detail

FeatureSeriesDatasetSelectionModel

public FeatureSeriesDatasetSelectionModel(SeriesDataset dataset)
Creates a new selection model.

Parameters:
dataset - a dataset providing FeatureDatasetMetaData as dataset group containing a Feature2SeriesDatasetMapping
Method Detail

isFeatureSelected

public boolean isFeatureSelected(String fID)
Checks if the data item of a feature is selected in any series.

Specified by:
isFeatureSelected in interface FeatureDatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>
Parameters:
fID - feature ID

isFeatureSelected

public boolean isFeatureSelected(String fID,
                                 Comparable<?> seriesKey)
Checks if the data item of a feature is selected.

Parameters:
fID - feature ID
seriesKey - series to check for the feature ID

setItemSelected

public void setItemSelected(String fID,
                            boolean selected)
Sets the selection state for a feature in all dataset series.

Specified by:
setItemSelected in interface FeatureDatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>
Parameters:
fID - feature ID
selected - flag to (de)select the item

setItemSelected

public void setItemSelected(String fID,
                            Comparable<?> seriesKey,
                            boolean selected)
Sets whether the data item of a feature is selected or not.

Parameters:
fID - feature ID
seriesKey - series to set the selection in
selected - flag to (de)select the item

changeItemSelection

public boolean changeItemSelection(String fID)
Changes the selection of the data item of a feature in all series.

Specified by:
changeItemSelection in interface FeatureDatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>
Parameters:
fID - feature ID
Returns:
true if at least one item changed to selected

changeItemSelection

public boolean changeItemSelection(String fID,
                                   Comparable<?> seriesKey)
Changes the selection of the data item of a feature.

Parameters:
fID - feature ID
seriesKey - series to change the selection in
Returns:
true if the item changed to selected

getSelectedFeatures

public Set<String> getSelectedFeatures()
Returns the IDs of the selected features (in any series).

Specified by:
getSelectedFeatures in interface FeatureDatasetSelectionModel<SeriesDataset,Comparable<?>,Integer>