public class SelectionManager
extends java.lang.Object
To get wholly selected features (i.e. not those that just have selected
parts or linestrings), use getFeatureSelection().getFeaturesWithSelectedItems()
To get features that are selected or have selected parts or linestrings,
use getFeaturesWithSelectedItems()
Yes there is a way to listen for selection events: LayerViewPanel#addListener.
Modifier and Type | Field and Description |
---|---|
protected int |
featuresWithSelectedItemsCount |
protected int |
selectedItems |
Constructor and Description |
---|
SelectionManager(LayerViewPanel panel,
LayerManagerProxy layerManagerProxy) |
Modifier and Type | Method and Description |
---|---|
boolean |
arePanelUpdatesEnabled() |
void |
clear() |
java.util.Collection |
createFeaturesFromSelectedItems()
A feature may get split into two or more -- for example, if two
linestrings of a feature are selected.
|
java.util.Collection |
createFeaturesFromSelectedItems(Layer layer) |
void |
dispose() |
FeatureSelection |
getFeatureSelection() |
java.util.Collection |
getFeaturesWithSelectedItems() |
java.util.Collection |
getFeaturesWithSelectedItems(Layer layer) |
int |
getFeaturesWithSelectedItemsCount() |
java.util.Collection<Layer> |
getLayersWithSelectedItems() |
LineStringSelection |
getLineStringSelection() |
PartSelection |
getPartSelection() |
java.util.Collection |
getSelectedItems()
"items" rather than "geometries" because the user may have selected a part
of a Geometry (an element of a GeometryCollection or a ring of a Polygon).
|
java.util.Collection |
getSelectedItems(Layer layer) |
java.util.Collection |
getSelectedItems(Layer layer,
Feature feature) |
java.util.Collection |
getSelectedItems(Layer layer,
Feature feature,
com.vividsolutions.jts.geom.Geometry geometry) |
int |
getSelectedItemsCount() |
java.util.Collection<AbstractSelection> |
getSelections() |
void |
setPanelUpdatesEnabled(boolean panelUpdatesEnabled) |
void |
unselectFromFeaturesWithModifiedItemCounts(Layer layer,
java.util.Collection features,
java.util.Collection oldFeatureClones) |
void |
unselectItems(Layer layer) |
void |
unselectItems(Layer layer,
java.util.Collection features) |
void |
updatePanel() |
protected int featuresWithSelectedItemsCount
protected int selectedItems
public SelectionManager(LayerViewPanel panel, LayerManagerProxy layerManagerProxy)
public java.util.Collection createFeaturesFromSelectedItems()
public java.util.Collection createFeaturesFromSelectedItems(Layer layer)
public void clear()
public FeatureSelection getFeatureSelection()
public LineStringSelection getLineStringSelection()
public java.util.Collection<AbstractSelection> getSelections()
public java.util.Collection getSelectedItems()
public int getSelectedItemsCount()
public java.util.Collection getSelectedItems(Layer layer)
public java.util.Collection getSelectedItems(Layer layer, Feature feature, com.vividsolutions.jts.geom.Geometry geometry)
geometry
- the feature's Geometry or equivalent; that is, a clone or
similar enough Geometry from which Geometries can be retrieved using
the selection indicespublic java.util.Collection<Layer> getLayersWithSelectedItems()
public PartSelection getPartSelection()
public void updatePanel()
public void setPanelUpdatesEnabled(boolean panelUpdatesEnabled)
public java.util.Collection getFeaturesWithSelectedItems(Layer layer)
public void unselectItems(Layer layer)
public void unselectItems(Layer layer, java.util.Collection features)
public void unselectFromFeaturesWithModifiedItemCounts(Layer layer, java.util.Collection features, java.util.Collection oldFeatureClones)
public java.util.Collection getFeaturesWithSelectedItems()
public int getFeaturesWithSelectedItemsCount()
public boolean arePanelUpdatesEnabled()
public void dispose()