Record Class DragRequest

java.lang.Object
java.lang.Record
limn.backend.spi.DragRequest
Record Components:
content - what is dragged
actions - what a target may do with it, the source's preference first
image - the picture under the pointer, in framebuffer pixels, or null for none
x - where the picture's left edge is as the drag begins, in the window's logical points
y - where the picture's top edge is as the drag begins, in the window's logical points
width - the picture's width on screen, in logical points
height - the picture's height on screen, in logical points
ended - told on the UI thread, once, when the system's drag is over, with the action a target carried out in this program or another, and with no action when nothing took it

public record DragRequest(Transfer content, Set<DropAction> actions, @Nullable Image image, float x, float y, float width, float height, Consumer<@Nullable DropAction> ended) extends Record
A drag the scene hands to the system: what it carries, what may be done with it, the picture the system shows under the pointer, and who hears the end.
  • Constructor Details

    • DragRequest

      public DragRequest(Transfer content, Set<DropAction> actions, @Nullable Image image, float x, float y, float width, float height, Consumer<@Nullable DropAction> ended)
      Creates an instance of a DragRequest record class.
      Parameters:
      content - the value for the content record component
      actions - the value for the actions record component
      image - the value for the image record component
      x - the value for the x record component
      y - the value for the y record component
      width - the value for the width record component
      height - the value for the height record component
      ended - the value for the ended record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • content

      public Transfer content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • actions

      public Set<DropAction> actions()
      Returns the value of the actions record component.
      Returns:
      the value of the actions record component
    • image

      public @Nullable Image image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component
    • x

      public float x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • y

      public float y()
      Returns the value of the y record component.
      Returns:
      the value of the y record component
    • width

      public float width()
      Returns the value of the width record component.
      Returns:
      the value of the width record component
    • height

      public float height()
      Returns the value of the height record component.
      Returns:
      the value of the height record component
    • ended

      public Consumer<@Nullable DropAction> ended()
      Returns the value of the ended record component.
      Returns:
      the value of the ended record component