Class Cursor.Builder<B extends Cursor.Builder<B>>

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

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

      public B setFallback(Cursor fallback)
      Cursor to fall back to if this cursor cannot be displayed.
      Parameters:
      fallback - the value for the fallback property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHotspotX

      public B setHotspotX(int hotspotX)
      X position of the cursor hotspot in the cursor image.
      Parameters:
      hotspotX - the value for the hotspot-x property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setHotspotY

      public B setHotspotY(int hotspotY)
      Y position of the cursor hotspot in the cursor image.
      Parameters:
      hotspotY - the value for the hotspot-y property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setName

      public B setName(String name)

      Name of this this cursor.

      The name will be null if the cursor was created from a texture.

      Parameters:
      name - the value for the name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setTexture

      public B setTexture(Texture texture)

      The texture displayed by this cursor.

      The texture will be null if the cursor was created from a name.

      Parameters:
      texture - the value for the texture property
      Returns:
      the Builder instance is returned, to allow method chaining