Class ALspMultiObjectHandle

java.lang.Object
com.luciad.view.lightspeed.editor.handle.ALspHandle
com.luciad.view.lightspeed.editor.handle.ALspMultiObjectHandle
Direct Known Subclasses:
TLspMultiObjectTranslationHandle

public abstract class ALspMultiObjectHandle extends ALspHandle
An abstract base class for handles that can work on a collection of objects. Multi object handles are used by the edit controller when more than one object is being edited simultaneously. Apart from that, the API and the responsibilities of a multi object handle are identical to those of a regular ALspEditHandle.

The typical use case for multi object handles is allowing multiple selected objects to be dragged around as a group. This behavior is implemented by TLspMultiObjectTranslationHandle.

Since:
2012.0
See Also:
  • Constructor Details

    • ALspMultiObjectHandle

      protected ALspMultiObjectHandle(Collection<TLspDomainObjectContext> aDomainObjectContexts)
      Creates a new handle for the given collection of domain objects.
      Parameters:
      aDomainObjectContexts - a collection of domain objects.
  • Method Details

    • getObjects

      public Collection<TLspDomainObjectContext> getObjects()
      Returns the collection of domain objects handled by this handle.
      Returns:
      the collection of domain objects handled by this handle.
    • handleAWTEvent

      public abstract TLspEditHandleResult handleAWTEvent(AWTEvent aEvent, TLspMultiObjectEditContext aEditContext)
      Handle the given input event for the given view. The edit handle can choose the action to perform based on the type and state of the input event.

      As a side effect, a handle is allowed to activate or deactivate itself as a result of processing an input event.

      When the handle has processed the input event, the edit handle result might contain an AWTEvent that is null, indicating that the given event has been fully consumed. Note that sometimes an event might be partially consumed (which is often the case with touch events), in which case this method will return an altered version of the given input event.

      Parameters:
      aEvent - the input event
      aEditContext - the edit context, containing, among others, the objects being edited, its layers, the view, the geometries that are being edited, the paint representations in which the geometries exist, and the sensitivity with which the event should be handled.
      Returns:
      An edit handle result containing some edit operations and the processed AWTEvent that is potentially partially consumed.
      See Also:
    • handleFXEvent

      public TLspEditHandleResultFX handleFXEvent(Event aEvent, TLspMultiObjectEditContext aEditContext)
      Parameters:
      aEvent - the input event
      aEditContext - the edit context, containing, among others, the objects being edited, its layers, the view, the geometries that are being edited, the paint representations in which the geometries exist, and the sensitivity with which the event should be handled.
      Returns:
      An edit handle result containing some edit operations and the processed AWTEvent that is potentially partially consumed.
      Since:
      2020.0
    • requestsFocus

      public boolean requestsFocus(AWTEvent aEvent, TLspMultiObjectEditContext aEditContext)
      Indicates whether this handle requests focus for the given event. The edit controller can respond to this by forwarding event objects to this handle, however, this is not ensured, since another handle, which might have precedence over this handle might also request focus. Precedence is primarily determined by handle priority).

      The default implementation returns true if the handle is active. Subclasses can override this method however to also request focus when the focus point hovers over a visual handle component for example.

      Parameters:
      aEvent - the AWTEvent that might result in a focus request
      aEditContext - the edit context, containing, among others, the objects being edited, its layers, the view, the geometries that are being edited, the paint representations in which the geometries exist, and the sensitivity with which the event should be handled.
      Returns:
      true if this handle requests focus, false otherwise. The base implementation checks if the handle is active
      See Also:
    • requestsFocus

      public boolean requestsFocus(Event aEvent, TLspMultiObjectEditContext aEditContext)
      Parameters:
      aEvent - the event that might result in a focus request
      aEditContext - the edit context, containing, among others, the objects being edited, its layers, the view, the geometries that are being edited, the paint representations in which the geometries exist, and the sensitivity with which the event should be handled.
      Returns:
      true if this handle requests focus, false otherwise. The base implementation checks if the handle is active
      Since:
      2020.0