Class DropEvent

java.lang.Object
limn.scene.event.DropEvent

public final class DropEvent extends Object
What was dragged is dropped on the widget that last accepted it. The widget reads what it wants from offer() and carries out action(); unless it calls reject() before returning, the source is told that action was done.
  • Constructor Details

    • DropEvent

      public DropEvent(float x, float y, int modifiers, boolean keyboard, Offer offer, DropAction action, @Nullable Object source)
      Parameters:
      x - the pointer, in scene coordinates
      y - the pointer, in scene coordinates
      modifiers - the modifier keys held
      keyboard - whether the keyboard drove the drag
      offer - what was dragged
      action - the action the widget accepted
      source - the widget the drag began on, or null when it began in another program
  • Method Details

    • x

      public float x()
      Returns:
      the pointer, in scene coordinates
    • y

      public float y()
      Returns:
      the pointer, in scene coordinates
    • modifiers

      public int modifiers()
      Returns:
      the modifier keys held, as Keys.MOD_* bits
    • isKeyboard

      public boolean isKeyboard()
      Returns:
      whether the keyboard drove the drag: the place is the one the widget kept
    • offer

      public Offer offer()
      Returns:
      what was dragged; a read may complete after this event returns
    • action

      public DropAction action()
      Returns:
      the action this widget accepted while the drag was over it
    • source

      public @Nullable Object source()
      Returns:
      the widget the drag began on, or null when it began in another program
    • reject

      public void reject()
      Refuses the drop after all: the source is told that nothing took it.
    • isRejected

      public boolean isRejected()
      Returns:
      whether the drop was refused