Class GesturePan

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class GesturePan extends GestureDrag

Recognizes pan gestures.

These are drags that are locked to happen along one axis. The axis that a GtkGesturePan handles is defined at construct time, and can be changed through setOrientation(Orientation).

When the gesture starts to be recognized, GtkGesturePan will attempt to determine as early as possible whether the sequence is moving in the expected direction, and denying the sequence if this does not happen.

Once a panning gesture along the expected axis is recognized, the Gtk.GesturePan::pan signal will be emitted as input events are received, containing the offset in the given axis.

  • Constructor Details

    • GesturePan

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

      public GesturePan(Orientation orientation)
      Returns a newly created GtkGesture that recognizes pan gestures.
      Parameters:
      orientation - expected orientation
    • GesturePan

      public GesturePan()
      Create a new GesturePan.
  • Method Details

    • getType

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

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

      protected GesturePan 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 GestureDrag
      Returns:
      the instance as if it were its parent type
    • getOrientation

      public Orientation getOrientation()
      Returns the orientation of the pan gestures that this this GesturePan expects.
      Returns:
      the expected orientation for pan gestures
    • setOrientation

      public void setOrientation(Orientation orientation)
      Sets the orientation to be expected on pan gestures.
      Parameters:
      orientation - expected orientation
    • onPan

      Emitted once a panning gesture along the expected axis is detected.
      Parameters:
      handler - the signal handler
      Returns:
      a signal handler ID to keep track of the signal connection
      See Also:
    • emitPan

      public void emitPan(PanDirection direction, double offset)
      Emits the "pan" signal. See onPan(GesturePan.PanCallback).
    • builder

      public static GesturePan.Builder<? extends GesturePan.Builder> builder()
      A GesturePan.Builder object constructs a GesturePan with the specified properties. Use the various set...() methods to set properties, and finish construction with GesturePan.Builder.build().
      Returns:
      the builder object