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  SelectableXMapPane mapPane
           
static String SELECTION_STYLING_FTS_NAME
          This constant is set as the FeatureTypeStyle#getName() attribute in the FeatureTypeStyles that only exist to present the selected features
protected  StyledFeaturesInterface<?> styledLayer
           
 
Fields inherited from class skrueger.geotools.selection.StyledLayerSelectionModelSynchronizer
layerSelModel, LOGGER, selectionChangeCausedByMe
 
Constructor Summary
FeatureMapLayerSelectionSynchronizer(StyledFeatureLayerSelectionModel layerSelModel, StyledFeaturesInterface<?> styledLayer, MapLayer mapLayer, SelectableXMapPane mapPane, MapPaneToolBar toolBar)
          Creates a new synchronizer
 
Method Summary
 void performMapPaneEvent(MapPaneEvent 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_FTS_NAME

public static final String SELECTION_STYLING_FTS_NAME
This constant is set as the FeatureTypeStyle#getName() attribute in the FeatureTypeStyles that only exist to present the selected features

See Also:
Constant Field Values

mapLayer

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


styledLayer

protected final StyledFeaturesInterface<?> styledLayer

mapPane

protected final SelectableXMapPane mapPane
Constructor Detail

FeatureMapLayerSelectionSynchronizer

public FeatureMapLayerSelectionSynchronizer(StyledFeatureLayerSelectionModel layerSelModel,
                                            StyledFeaturesInterface<?> styledLayer,
                                            MapLayer mapLayer,
                                            SelectableXMapPane 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(MapPaneEvent e)
Used to synchronize FeatureSelectedEvents with the StyledFeatureLayerSelectionModel

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