Class ALcyObjectSelectionAction<S extends ILcdView & ILcdTreeLayered>

java.lang.Object
com.luciad.gui.ALcdAction
com.luciad.lucy.map.action.ALcyObjectSelectionAction<S>
All Implemented Interfaces:
ILcdAction, ILcdUndoableSource, ILcdPropertyChangeSource, ActionListener, Serializable, EventListener

@Deprecated public abstract class ALcyObjectSelectionAction<S extends ILcdView & ILcdTreeLayered> extends ALcdAction implements ILcdUndoableSource
Deprecated.

Action that works on the current map selection. It is typically used as an action in a right click menu.

Extensions can provide a filter that decides on which objects to work. The action disables itself when no suitable objects are selected. Depending on isAutoHide(), the action also makes itself invisible when not applicable (useful for pop-up menus, enabled by default).

Optionally, implementations can support undo/redo by invoking fireUndoableHappened(com.luciad.gui.ILcdUndoable) when they change state.

Since:
2012.0
See Also:
  • Constructor Details

    • ALcyObjectSelectionAction

      public ALcyObjectSelectionAction(S aView, ILcdFilter<TLcyDomainObjectContext> aObjectFilter)
      Deprecated.
      Constructs a new ALcyLspObjectSelectionAction. It takes a filter to decide which objects should be taken into account. The action is enabled when exactly one object is selected and when that object is accepted by the filter, disabled otherwise.
      Parameters:
      aView - The view to work on.
      aObjectFilter - Sets the object filter. The filter is used to detect if the objects of the map selection are recognized (accepted) by this action. The object given to the filter is never null.
    • ALcyObjectSelectionAction

      public ALcyObjectSelectionAction(S aView, ILcdFilter<TLcyDomainObjectContext> aObjectFilter, int aMinObjectCount, int aMaxObjectCount, boolean aStrict)
      Deprecated.
      Constructs a new ALcyLspObjectSelectionAction. It takes a filter to decide which objects should be taken into account. The action is enabled if the number of objects that are accepted by the filter is in the given min/max interval, disabled otherwise.
      Parameters:
      aView - The view to work on.
      aObjectFilter - Sets the object filter. The filter is used to detect if the objects of the map selection are recognized (accepted) by this action. If all objects of the map selection are recognized, the action is enabled. The given object is never null.
      aMinObjectCount - Defines the minimum number of objects that should pass the filter for the action to be enabled.
      aMaxObjectCount - Defines the maximum number of objects that should pass the filter for the action to be enabled. You can use -1 as a short cut for Integer.MAX_VALUE, to leave the maximum unbounded.
      aStrict - True means the action disables itself when one or more objects that are selected, were not accepted by the filter. When false, the action simply ignores the objects that weren't accepted by the filter.
  • Method Details

    • getView

      public S getView()
      Deprecated.
      Returns the view as it was provided to the constructor.
      Returns:
      the view as it was provided to the constructor.
    • addUndoableListener

      public void addUndoableListener(ILcdUndoableListener aUndoableListener)
      Deprecated.
      Description copied from interface: ILcdUndoableSource
      Adds a listener to this source, so this listener is notified when something undoable has happened.
      Specified by:
      addUndoableListener in interface ILcdUndoableSource
      Parameters:
      aUndoableListener - The listener to be notified when something undoable has happened.
    • removeUndoableListener

      public void removeUndoableListener(ILcdUndoableListener aUndoableListener)
      Deprecated.
      Description copied from interface: ILcdUndoableSource
      Removes the specified listener so it is no longer notified.
      Specified by:
      removeUndoableListener in interface ILcdUndoableSource
      Parameters:
      aUndoableListener - The listener to remove.
    • fireUndoableHappened

      protected final void fireUndoableHappened(ILcdUndoable aUndoable)
      Deprecated.
      Fires the given ILcdUndoable to all associated ILcdUndoableListeners. Extensions of this class should use this method if they want to support undo/redo.
      Parameters:
      aUndoable - The ILcdUndoable to fire. All registered ILcdUndoableListener instances will be notified of this undoable.
    • isAutoHide

      public boolean isAutoHide()
      Deprecated.
      Returns the auto hide property, see setAutoHide(boolean).
      Returns:
      the auto hide property.
    • setAutoHide

      public void setAutoHide(boolean aAutoHide)
      Deprecated.

      Sets if the action should hide itself when it is disabled. This is convenient when used in a context menu.

      Hiding means the ILcdAction.VISIBLE key is changed to false, it is up to the container of this action to effectively hide it from the UI. This shouldn't be an issue as all provided ILcyActionBar implementations do so.

      Parameters:
      aAutoHide - True to automatically hide the action when it is disabled, false to avoid that the action changes its visibility.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Deprecated.
      Specified by:
      actionPerformed in interface ActionListener
    • actionPerformed

      protected abstract void actionPerformed(ActionEvent aActionEvent, List<TLcyDomainObjectContext> aSelection)
      Deprecated.
      Performs what the action should do. Only invoked when the selection is compliant with the restrictions imposed by the filter, min/max interval and the strict setting of the constructor.
      Parameters:
      aActionEvent - The action event.
      aSelection - The list with selected objects that were accepted by the filter. They are provided as TLcyDomainObjectContext instances, so that their layer and model is also available. Never contains null values. The size of the list is within the min/max interval specified in the constructor. When using the constructor that does not specify this interval, the list size is always 1.