skrueger.geotools.selection
Class ChartSelectionSynchronizer

java.lang.Object
  extended by skrueger.geotools.selection.StyledLayerSelectionModelSynchronizer<StyledFeatureLayerSelectionModel>
      extended by skrueger.geotools.selection.ChartSelectionSynchronizer
All Implemented Interfaces:
PropertyChangeListener, EventListener, DatasetSelectionListener

public class ChartSelectionSynchronizer
extends StyledLayerSelectionModelSynchronizer<StyledFeatureLayerSelectionModel>
implements DatasetSelectionListener

This class keeps the selection of a Dataset (based on feature attributes) synchronized with the StyledLayerSelectionModel of a layer. This is done by implementing:

After creating, the instance of this synchronizer must be added as listener to both, the StyledLayerSelectionModel and the chart's DatasetSelectionModel (e.g. the renderer).

Author:
Martin Schmitz
See Also:
DatasetSelectionModelProvider

Field Summary
protected  FeatureDatasetSelectionModel<?,?,?> datasetSelModel
          Holds the chart datset to keep synchronized with the layer selection model.
 
Fields inherited from class skrueger.geotools.selection.StyledLayerSelectionModelSynchronizer
layerSelModel, LOGGER, selectionChangeCausedByMe
 
Constructor Summary
ChartSelectionSynchronizer(StyledFeatureLayerSelectionModel layerSelModel, FeatureDatasetSelectionModel<?,?,?> datasetSelModel)
          Creates a new synchronizer.
 
Method Summary
 void propertyChange(PropertyChangeEvent evt)
          Called by StyledLayerSelectionModel when the selection on other selection components (map, table, ...) has changed.
 void selectionChanged(DatasetSelectionChangeEvent evt)
          Called when the chart selection is changed by the user.
 
Methods inherited from class skrueger.geotools.selection.StyledLayerSelectionModelSynchronizer
isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

datasetSelModel

protected FeatureDatasetSelectionModel<?,?,?> datasetSelModel
Holds the chart datset to keep synchronized with the layer selection model.

Constructor Detail

ChartSelectionSynchronizer

public ChartSelectionSynchronizer(StyledFeatureLayerSelectionModel layerSelModel,
                                  FeatureDatasetSelectionModel<?,?,?> datasetSelModel)
Creates a new synchronizer.

Parameters:
layerSelModel - layer selection model to keep synchronized with the dataset selection model
datasetSelModel - dataset selection model to keep synchronized with the layer selection model
Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Called by StyledLayerSelectionModel when the selection on other selection components (map, table, ...) has changed. When calling this method changes the dataset selection according to the StyledLayerSelectionModel selection.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
evt - an event

selectionChanged

public void selectionChanged(DatasetSelectionChangeEvent evt)
Called when the chart selection is changed by the user. When calling this method changes the selection of the StyledLayerSelectionModel.

Specified by:
selectionChanged in interface DatasetSelectionListener
Parameters:
evt - an event