Class TLcdSelectionSupport<T>

java.lang.Object
com.luciad.util.TLcdSelectionSupport<T>
All Implemented Interfaces:
ILcdSelection<T>

public class TLcdSelectionSupport<T> extends Object implements ILcdSelection<T>
This class provides support for implementing ILcdSelection. Classes can extend it, or they can create an instance of it and delegate methods to the instance. A TLcdSelectionSupport maintains a selection of objects. It can send out TLcdSelectionChangedEvent objects to a list of ILcdSelectionListener objects whenever the selection is changed.
See Also:
  • Constructor Details

    • TLcdSelectionSupport

      public TLcdSelectionSupport(ILcdSelection<T> aSelection)
      Creates a new TLcdSelectionSupport for the given ILcdSelection. The selection must not be null.
      Parameters:
      aSelection - the ILcdSelection that will be specified in any TLcdSelectionChangedEvent objects that are sent out.
      Throws:
      NullPointerException - when the selection passed is null.
  • Method Details

    • setClassTraceOn

      public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
    • setTraceOn

      public void setTraceOn(boolean aTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for this class instance. Calling this method with either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Parameters:
      aTraceOn - if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
    • isTraceOn

      public boolean isTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • getSelectionCount

      public int getSelectionCount()
      Description copied from interface: ILcdSelection
      Returns the number of objects in this selection.
      Specified by:
      getSelectionCount in interface ILcdSelection<T>
      Returns:
      the number of objects in this ILcdSelection.
    • selectedObjects

      public Enumeration<T> selectedObjects()
      Description copied from interface: ILcdSelection
      Returns the objects in this selection.
      Specified by:
      selectedObjects in interface ILcdSelection<T>
      Returns:
      the objects currently in this ILcdSelection.
    • isSelected

      public boolean isSelected(Object aObject)
      Checks whether the given Object is currently in the set of selected objects.
      Specified by:
      isSelected in interface ILcdSelection<T>
      Parameters:
      aObject - the Object to be checked.
      Returns:
      true if the Object is in this ILcdSelection, as determined by the equals method; false otherwise.
    • addSelectionListener

      public void addSelectionListener(ILcdSelectionListener<T> aSelectionListener)
      Adds the given listener to the list of objects that will be notified by any selection changed passed in fireSelectionEvent(TLcdSelectionChangedEvent). The listener must not be null.
      Specified by:
      addSelectionListener in interface ILcdSelection<T>
      Parameters:
      aSelectionListener - the object that will be notified of any changes to the selection set.
      Throws:
      NullPointerException - when null is passed as a listener.
    • removeSelectionListener

      public void removeSelectionListener(ILcdSelectionListener<T> aSelectionListener)
      Description copied from interface: ILcdSelection
      Removes an ILcdSelectionListener from this ILcdSelection.
      Specified by:
      removeSelectionListener in interface ILcdSelection<T>
      Parameters:
      aSelectionListener - the ILcdSelectionListener to be removed.
    • selectObject

      public void selectObject(T aObject, boolean aSelection, int aDispatchEventMode)
      Adds/removes the given Object to/from the selection.
      Parameters:
      aObject - the Object to be added or removed.
      aSelection - true if the given Object has to be added, false if it has to be removed.
      aDispatchEventMode - the mode for sending out the event: ILcdFireEventMode.NO_EVENT, ILcdFireEventMode.FIRE_NOW, or ILcdFireEventMode.FIRE_LATER.
      See Also:
    • selectObjects

      public void selectObjects(Collection<? extends T> aObjects, boolean aSelection, int aDispatchEventMode)
      Adds/removes the given Objects to/from the selection.
      Parameters:
      aObjects - the Objects to be added or removed. There must not be any duplicate objects in this list, nor should it be null.
      aSelection - true if the given Objects have to be added to the selection, false if they have to be removed.
      aDispatchEventMode - the mode for sending out the event: ILcdFireEventMode.NO_EVENT, ILcdFireEventMode.FIRE_NOW, or ILcdFireEventMode.FIRE_LATER.
      See Also:
    • clearSelection

      public void clearSelection(int aDispatchEventMode)
      Clears the selection.
      Parameters:
      aDispatchEventMode - the mode for sending out the event: ILcdFireEventMode.NO_EVENT, ILcdFireEventMode.FIRE_NOW, or ILcdFireEventMode.FIRE_LATER.
      See Also:
    • fireSelectionEvent

      protected void fireSelectionEvent(TLcdSelectionChangedEvent<T> aSelectionEvent)
      Fires a TLcdSelectionChangedEvent to all the registered listeners.
      Parameters:
      aSelectionEvent - the event to be sent out.
    • fireCollectedSelectionChanges

      public void fireCollectedSelectionChanges()
      Fires a TLcdSelectionChangedEvent that contains all the collected selection changes.
    • log

      public void log()