Class ScrollEvent

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class ScrollEvent extends Event
An event related to a scrolling motion.
  • Constructor Details

    • ScrollEvent

      public ScrollEvent(MemorySegment address)
      Create a ScrollEvent instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the ScrollEvent class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected ScrollEvent asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class Event
      Returns:
      the instance as if it were its parent type
    • getDeltas

      public void getDeltas(Out<Double> deltaX, Out<Double> deltaY)

      Extracts the scroll deltas of a scroll event.

      The deltas will be zero unless the scroll direction is ScrollDirection.SMOOTH.

      For the representation unit of these deltas, see getUnit().

      Parameters:
      deltaX - return location for x scroll delta
      deltaY - return location for y scroll delta
    • getDirection

      public ScrollDirection getDirection()
      Extracts the direction of a scroll event.
      Returns:
      the scroll direction of this ScrollEvent
    • getRelativeDirection

      public ScrollRelativeDirection getRelativeDirection()
      Extracts the scroll direction relative to the physical motion.
      Returns:
      the relative scroll direction.
      Since:
      4.20
    • getUnit

      public ScrollUnit getUnit()

      Extracts the scroll delta unit of a scroll event.

      The unit will always be ScrollUnit.WHEEL if the scroll direction is not ScrollDirection.SMOOTH.

      Returns:
      the scroll unit.
      Since:
      4.8
    • isStop

      public boolean isStop()

      Check whether a scroll event is a stop scroll event.

      Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity.

      Stop scroll events always have a delta of 0/0.

      Returns:
      true if the event is a scroll stop event