Class TLcdSelectionChangedEvent<T>

java.lang.Object
java.util.EventObject
com.luciad.util.TLcdSelectionChangedEvent<T>
All Implemented Interfaces:
Serializable

public class TLcdSelectionChangedEvent<T> extends EventObject
Event object to inform ILcdSelectionListener objects of selection changes in an ILcdSelection.
See Also:
  • Constructor Details

    • TLcdSelectionChangedEvent

      public TLcdSelectionChangedEvent(ILcdSelection<T> aSelection, Vector<T> aSelectedObjects, Vector<T> aDeselectedObjects)
      Deprecated.
      use the constructor with the map.
      Creates a new TLcdSelectionChangedEvent with the given information.
      Parameters:
      aSelection - the ILcdSelection that is firing this TLcdSelectionChangedEvent.
      aSelectedObjects - the objects for which the selection state changed from not selected to selected.
      aDeselectedObjects - the objects for which the selection state changed from selected to not selected. Note: an object should only be in one of the vectors, not in both.
    • TLcdSelectionChangedEvent

      public TLcdSelectionChangedEvent(ILcdSelection<T> aSelection, Map<T,Boolean> aSelectionChanges)
      Creates a new TLcdSelectionChangedEvent with the given information.
      Parameters:
      aSelection - the ILcdSelection that is firing this TLcdSelectionChangedEvent.
      aSelectionChanges - the Map containing the selection changes. The keys of this Map must be the objects whose selection states have changed. The value associated to a given key must be a Boolean instance that is true if the Object has been selected or false if it has been deselected. It is recommended to use an IdentityHashMap.
  • Method Details

    • getChangedObjects

      public Collection<T> getChangedObjects()
      Returns the objects for which the selection state has changed.
      Returns:
      the objects for which the selection state has changed.
      See Also:
    • getSelection

      public ILcdSelection<T> getSelection()
      Returns the ILcdSelection that has fired this TLcdSelectionChangedEvent. This the same Object as the one returned by getSource().
      Returns:
      the ILcdSelection that has fired this TLcdSelectionChangedEvent. This the same Object as the one returned by getSource().
    • elements

      public Enumeration elements()
      Deprecated.
      Returns an Enumeration of all the objects for which the selection state has changed.
      Returns:
      an Enumeration of all the objects for which the selection state has changed.
      See Also:
    • elementCount

      public int elementCount()
      Returns the number of Objects for which the selection state has changed.
      Returns:
      the number of Objects for which the selection state has changed.
    • getElementAt

      public T getElementAt(int aIndex)
      Returns the object at a given index for which the selection state has changed.
      Returns:
      the object at a given index for which the selection state has changed.
    • selectedElements

      public Enumeration<T> selectedElements()
      Returns all objects for which the state has changed from deselected to selected.
      Returns:
      all objects for which the state has changed from deselected to selected.
    • deselectedElements

      public Enumeration<T> deselectedElements()
      Returns all objects for which the state has changed from selected to deselected.
      Returns:
      all objects for which the state has changed from selected to deselected.
    • containsElement

      public boolean containsElement(T aObject)
      Returns whether aObject is associated to this TLcdSelectionChangedEvent
      Returns:
      whether aObject is associated to this TLcdSelectionChangedEvent
    • retrieveChange

      public boolean retrieveChange(T aObject)
      Returns the details concerning aObject in this TLcdModelChangedEvent, false if the object has been deselected, true if the object has been selected. Warning: to retrieve the changes for all objects use the methods selectedElements() and deselectedElements() which result in a better performance.
      Returns:
      the details concerning aObject in this TLcdModelChangedEvent, false if the object has been deselected, true if the object has been selected.
      Throws:
      IllegalArgumentException - when a object was passed which was not in the selection changes.
    • toString

      public String toString()
      Overrides:
      toString in class EventObject