Class SelectionManager

java.lang.Object
com.vividsolutions.jump.workbench.ui.SelectionManager

public class SelectionManager extends Object
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 Details

    • featuresWithSelectedItemsCount

      protected int featuresWithSelectedItemsCount
    • selectedItems

      protected int selectedItems
  • Constructor Details

  • Method Details

    • createFeaturesFromSelectedItems

      public Collection<Feature> createFeaturesFromSelectedItems()
      A feature may get split into two or more -- for example, if two linestrings of a feature are selected.
    • createFeaturesFromSelectedItems

      public Collection<Feature> createFeaturesFromSelectedItems(Layer layer)
    • clear

      public void clear()
    • getFeatureSelection

      public FeatureSelection getFeatureSelection()
    • getLineStringSelection

      public LineStringSelection getLineStringSelection()
    • getSelections

      public Collection<AbstractSelection> getSelections()
      Returns:
      AbstractSelections
    • getSelectedItems

      public Collection<org.locationtech.jts.geom.Geometry> 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

      public Collection<org.locationtech.jts.geom.Geometry> getSelectedItems(Layer layer)
    • 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

      public Collection<Layer> getLayersWithSelectedItems()
    • getPartSelection

      public PartSelection getPartSelection()
    • updatePanel

      public void updatePanel()
    • setPanelUpdatesEnabled

      public void setPanelUpdatesEnabled(boolean panelUpdatesEnabled)
    • getFeaturesWithSelectedItems

      public Collection<Feature> getFeaturesWithSelectedItems(Layer layer)
    • unselectItems

      public void unselectItems(Layer layer)
    • unselectItems

      public void unselectItems(Layer layer, Collection features)
    • unselectFromFeaturesWithModifiedItemCounts

      public void unselectFromFeaturesWithModifiedItemCounts(Layer layer, Collection<Feature> features, Collection<Feature> oldFeatureClones)
    • getFeaturesWithSelectedItems

      public Collection<Feature> getFeaturesWithSelectedItems()
    • getFeaturesWithSelectedItemsCount

      public int getFeaturesWithSelectedItemsCount()
    • arePanelUpdatesEnabled

      public boolean arePanelUpdatesEnabled()
    • dispose

      public void dispose()