skrueger.geotools.selection
Class FeatureMapLayerSelectionSynchronizer

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

public class FeatureMapLayerSelectionSynchronizer
extends StyledLayerSelectionModelSynchronizer<StyledFeatureLayerSelectionModel>
implements JMapPaneListener

This class keeps the selection of a (feature) JTable 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 table's ListSelectionModel.

Author:
Martin Schmitz (University of Bonn/Germany)

Field Summary
protected  MapLayer mapLayer
          Holds the MapLayer to keep synchronized with the layer selection model.
protected  JMapPane mapPane
           
static String SELECTION_STYLING
           
protected  StyledLayerInterface<?> styledLayer
           
 
Fields inherited from class skrueger.geotools.selection.StyledLayerSelectionModelSynchronizer
layerSelModel, LOGGER, selectionChangeCausedByMe
 
Constructor Summary
FeatureMapLayerSelectionSynchronizer(StyledFeatureLayerSelectionModel layerSelModel, StyledLayerInterface<?> styledLayer, MapLayer mapLayer, JMapPane mapPane, MapPaneToolBar toolBar)
          Creates a new synchronizer
 
Method Summary
 void performMapPaneEvent(JMapPaneEvent e)
          Used to synchronize FeatureSelectedEvents with the StyledFeatureLayerSelectionModel
 void propertyChange(PropertyChangeEvent evt)
          Called by StyledLayerSelectionModel when a the selection on other selection components (map, chart, ...) has changed.
 
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

SELECTION_STYLING

public static final String SELECTION_STYLING
See Also:
Constant Field Values

mapLayer

protected final MapLayer mapLayer
Holds the MapLayer to keep synchronized with the layer selection model.


styledLayer

protected final StyledLayerInterface<?> styledLayer

mapPane

protected final JMapPane mapPane
Constructor Detail

FeatureMapLayerSelectionSynchronizer

public FeatureMapLayerSelectionSynchronizer(StyledFeatureLayerSelectionModel layerSelModel,
                                            StyledLayerInterface<?> styledLayer,
                                            MapLayer mapLayer,
                                            JMapPane mapPane,
                                            MapPaneToolBar toolBar)
Creates a new synchronizer

Parameters:
layerSelModel - layer selection model to keep synchronized with the MapLayer
mapLayer - MapLayer to keep synchronized with.
Method Detail

propertyChange

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

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

performMapPaneEvent

public void performMapPaneEvent(JMapPaneEvent e)
Used to synchronize FeatureSelectedEvents with the StyledFeatureLayerSelectionModel

Specified by:
performMapPaneEvent in interface JMapPaneListener
Parameters:
e - Ereignis