Class SelectionManager
java.lang.Object
com.vividsolutions.jump.workbench.ui.SelectionManager
Provides aggregate information for selected features, parts, and linestrings.
Note that there is a difference between "selected features" and "features with
selected items": the former consists of wholly selected features; the latter,
wholly and partially selected features. To access a specific level of selection,
use #getFeatureSelection, #getPartSelection, or #getLineStringSelection.
"Parts" are components of GeometryCollections.
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidclear()A feature may get split into two or more -- for example, if two linestrings of a feature are selected.voiddispose()intCollection<org.locationtech.jts.geom.Geometry> "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).Collection<org.locationtech.jts.geom.Geometry> getSelectedItems(Layer layer) Collection<org.locationtech.jts.geom.Geometry> getSelectedItems(Layer layer, Feature feature) Collection<org.locationtech.jts.geom.Geometry> getSelectedItems(Layer layer, Feature feature, org.locationtech.jts.geom.Geometry geometry) intvoidsetPanelUpdatesEnabled(boolean panelUpdatesEnabled) voidunselectFromFeaturesWithModifiedItemCounts(Layer layer, Collection<Feature> features, Collection<Feature> oldFeatureClones) voidunselectItems(Layer layer) voidunselectItems(Layer layer, Collection features) void
-
Field Details
-
featuresWithSelectedItemsCount
protected int featuresWithSelectedItemsCount -
selectedItems
protected int selectedItems
-
-
Constructor Details
-
SelectionManager
-
-
Method Details
-
createFeaturesFromSelectedItems
A feature may get split into two or more -- for example, if two linestrings of a feature are selected. -
createFeaturesFromSelectedItems
-
clear
public void clear() -
getFeatureSelection
-
getLineStringSelection
-
getSelections
- Returns:
- AbstractSelections
-
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).- Returns:
- a collection of Geometries
-
getSelectedItemsCount
public int getSelectedItemsCount() -
getSelectedItems
-
getSelectedItems
public Collection<org.locationtech.jts.geom.Geometry> getSelectedItems(Layer layer, Feature feature) -
getSelectedItems
public Collection<org.locationtech.jts.geom.Geometry> getSelectedItems(Layer layer, Feature feature, org.locationtech.jts.geom.Geometry geometry) - Parameters:
geometry- the feature's Geometry or equivalent; that is, a clone or similar enough Geometry from which Geometries can be retrieved using the selection indices
-
getLayersWithSelectedItems
-
getPartSelection
-
updatePanel
public void updatePanel() -
setPanelUpdatesEnabled
public void setPanelUpdatesEnabled(boolean panelUpdatesEnabled) -
getFeaturesWithSelectedItems
-
unselectItems
-
unselectItems
-
unselectFromFeaturesWithModifiedItemCounts
public void unselectFromFeaturesWithModifiedItemCounts(Layer layer, Collection<Feature> features, Collection<Feature> oldFeatureClones) -
getFeaturesWithSelectedItems
-
getFeaturesWithSelectedItemsCount
public int getFeaturesWithSelectedItemsCount() -
arePanelUpdatesEnabled
public boolean arePanelUpdatesEnabled() -
dispose
public void dispose()
-