Class DefaultSelectionManager<V extends GeoObject>


  • public class DefaultSelectionManager<V extends GeoObject>
    extends java.lang.Object
    A helper component that can be used by a Layer to keep track of the geo-objects selected
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultSelectionManager​(Layer parent)
      Crates a new instance associated to the given layer
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSelectionListener​(SelectionListener l)
      Adds a selection listener
      boolean clear()
      Clears the selection
      void fireSelectionChanged​(SelectionEvent evt)
      Notifies the given SelectionEvent to all the registered selection listeners
      java.util.List<V> getSelection()
      Gets a list of selected objects
      java.util.List<V> getSelection​(V obj)
      Returns selected objects that are children of the provided objects GeoObject's isSubElementOf() determines if an object is children of another object
      boolean isSelected​(V obj)
      True if the object is selected
      void removeSelectionListener​(SelectionListener l)
      Removes the given selection listener
      boolean select​(java.util.List<V> objs)
      Sets the objects in the list as selected without clearing the previous selections
      boolean setSelection​(java.util.List<V> objs)
      Sets all the objects in the list as selected.
      int size()
      Returns the number of selected objects
      boolean unselect​(java.util.List<V> objs)
      Marks the given objects as not selected
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultSelectionManager

        public DefaultSelectionManager​(Layer parent)
        Crates a new instance associated to the given layer
        Parameters:
        parent -
    • Method Detail

      • isSelected

        public boolean isSelected​(V obj)
        True if the object is selected
        Parameters:
        obj -
        Returns:
      • clear

        public boolean clear()
        Clears the selection
        Returns:
      • size

        public int size()
        Returns the number of selected objects
        Returns:
      • getSelection

        public java.util.List<V> getSelection()
        Gets a list of selected objects
        Returns:
      • getSelection

        public java.util.List<V> getSelection​(V obj)
        Returns selected objects that are children of the provided objects GeoObject's isSubElementOf() determines if an object is children of another object
        Parameters:
        obj -
        Returns:
      • setSelection

        public boolean setSelection​(java.util.List<V> objs)
        Sets all the objects in the list as selected. It clears the previous selection.
        Parameters:
        objs -
        Returns:
      • select

        public boolean select​(java.util.List<V> objs)
        Sets the objects in the list as selected without clearing the previous selections
        Parameters:
        objs -
        Returns:
      • unselect

        public boolean unselect​(java.util.List<V> objs)
        Marks the given objects as not selected
        Parameters:
        objs -
        Returns:
      • addSelectionListener

        public void addSelectionListener​(SelectionListener l)
        Adds a selection listener
        Parameters:
        l -
      • removeSelectionListener

        public void removeSelectionListener​(SelectionListener l)
        Removes the given selection listener
        Parameters:
        l -
      • fireSelectionChanged

        public void fireSelectionChanged​(SelectionEvent evt)
        Notifies the given SelectionEvent to all the registered selection listeners
        Parameters:
        evt -