Package org.gnome.gdk
Class Device.Builder<B extends Device.Builder<B>>
java.lang.Object
io.github.jwharm.javagi.gobject.Builder<B>
org.gnome.gobject.GObject.Builder<B>
org.gnome.gdk.Device.Builder<B>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Enclosing class:
Device
Inner class implementing a builder pattern to construct a GObject with
properties.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theDevice
object.onChanged
(Device.ChangedCallback handler) Emitted either when the number of either axes or keys changes.onToolChanged
(Device.ToolChangedCallback handler) Emitted on pen/eraser devices whenever tools enter or leave proximity.setDisplay
(Display display) TheGdkDisplay
theGdkDevice
pertains to.setHasCursor
(boolean hasCursor) Whether the device is represented by a cursor on the screen.The device name.setNumTouches
(int numTouches) The maximal number of concurrent touches on a touch device.setProductId
(String productId) Product ID of this device.GdkSeat
of this device.setSource
(InputSource source) Source type for the device.setVendorId
(String vendorId) Vendor ID of this device.Methods inherited from class org.gnome.gobject.GObject.Builder
onNotify
Methods inherited from class io.github.jwharm.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilder
object.
-
-
Method Details
-
build
Finish building theDevice
object. This will callGObject.withProperties(org.gnome.glib.Type, java.lang.String[], org.gnome.gobject.Value[])
to create a new GObject instance, which is then cast toDevice
.- Overrides:
build
in classGObject.Builder<B extends Device.Builder<B>>
- Returns:
- a new instance of
Device
with the properties that were set in the Builder object.
-
setDisplay
-
setHasCursor
Whether the device is represented by a cursor on the screen.- Parameters:
hasCursor
- the value for thehas-cursor
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setName
-
setNumTouches
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 thenum-touches
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setProductId
Product ID of this device.- Parameters:
productId
- the value for theproduct-id
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setSeat
-
setSource
Source type for the device.- Parameters:
source
- the value for thesource
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setVendorId
Vendor ID of this device.See
Device.getVendorId()
.- Parameters:
vendorId
- the value for thevendor-id
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onChanged
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
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:
-