Class TLspMultiObjectTranslationHandle


public class TLspMultiObjectTranslationHandle extends ALspMultiObjectHandle
A multi object translation handle works on multiple objects. It generates a single editing operation for a group of objects.
Since:
2012.0
  • Constructor Details

    • TLspMultiObjectTranslationHandle

      public TLspMultiObjectTranslationHandle(Collection<TLspDomainObjectContext> aDomainObjectContextList)
      Creates a translation handle to move the given editor. Translating the object is performed by pressing/clicking the left mouse button and dragging/moving.
      Parameters:
      aDomainObjectContextList - the list of domain objects to translate
  • Method Details

    • isActive

      public boolean isActive()
      Description copied from class: ALspHandle
      Checks whether this handle is active. When a handle is active, it will be the first candidate to receive events. If a handle is inactive, it might still receive events (possibly making it active) if all other active handles didn't process an event.
      Specified by:
      isActive in class ALspHandle
      Returns:
      true if active, false otherwise
    • getStyleTargetProviders

      public List<ALspStyleTargetProvider> getStyleTargetProviders(TLspHandleGeometryType aType)
      Returns a style target provider that can generate geometry for the given visual editing component type, or an empty list if no geometry can be generated for the given type. TLspEditHandleStyler allows you to register different styles for each visual component type.

      By default, this method returns an empty list.

      Specified by:
      getStyleTargetProviders in class ALspHandle
      Parameters:
      aType - a visual editing component type
      Returns:
      a list of style target providers, or an empty list if no style targets can be created for the given visual editing component type
    • 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.

      By default, this method returns true when this handle is active or when one of the objects (passed in the edit context) is touched.

      Overrides:
      requestsFocus in class ALspMultiObjectHandle
      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)
      Overrides:
      requestsFocus in class ALspMultiObjectHandle
      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
    • getCursor

      public Cursor getCursor()
      Description copied from class: ALspHandle
      Returns the cursor for this handle. In practice, this cursor is used when this handle is active, or when it has focus.
      Overrides:
      getCursor in class ALspHandle
      Returns:
      the cursor for this handle.
    • handleAWTEvent

      public 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.

      By default, this method returns an edit handle result containing a MOVE operation, or without operation, if for instance the mouse isn't moved.

      Specified by:
      handleAWTEvent in class ALspMultiObjectHandle
      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)
      Description copied from class: ALspMultiObjectHandle
      Overrides:
      handleFXEvent in class ALspMultiObjectHandle
      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.