Class Device.Builder<B extends Device.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Device

public static class Device.Builder<B extends Device.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Device build()
      Finish building the Device object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Device.
      Overrides:
      build in class GObject.Builder<B extends Device.Builder<B>>
      Returns:
      a new instance of Device with the properties that were set in the Builder object.
    • setDisplay

      public B setDisplay(Display display)
      The GdkDisplay the GdkDevice pertains to.
      Parameters:
      display - the value for the display property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHasCursor

      public B setHasCursor(boolean hasCursor)
      Whether the device is represented by a cursor on the screen.
      Parameters:
      hasCursor - the value for the has-cursor property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setName

      public B setName(String name)
      The device name.
      Parameters:
      name - the value for the name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setNumTouches

      public B setNumTouches(int numTouches)

      The maximal number of concurrent touches on a touch device.

      Will be 0 if the device is not a touch device or if the number of touches is unknown.

      Parameters:
      numTouches - the value for the num-touches property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setProductId

      public B setProductId(String productId)

      Product ID of this device.

      See Device.getProductId().

      Parameters:
      productId - the value for the product-id property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSeat

      public B setSeat(Seat seat)
      GdkSeat of this device.
      Parameters:
      seat - the value for the seat property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSource

      public B setSource(InputSource source)
      Source type for the device.
      Parameters:
      source - the value for the source property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setVendorId

      public B setVendorId(String vendorId)

      Vendor ID of this device.

      See Device.getVendorId().

      Parameters:
      vendorId - the value for the vendor-id property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onChanged

      public B onChanged(Device.ChangedCallback handler)

      Emitted either when the number of either axes or keys changes.

      On X11 this will normally happen when the physical device routing events through the logical device changes (for example, user switches from the USB mouse to a tablet); in that case the logical device will change to reflect the axes and keys on the new physical device.

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onToolChanged

      public B onToolChanged(Device.ToolChangedCallback handler)
      Emitted on pen/eraser devices whenever tools enter or leave proximity.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: