Class Gesture.Builder<B extends Gesture.Builder<B>>
- Type Parameters:
B
- the type of the Builder that is returned
- All Implemented Interfaces:
BuilderInterface
- Direct Known Subclasses:
GestureRotate.Builder
,GestureSingle.Builder
,GestureZoom.Builder
- Enclosing class:
Gesture
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Finish building theGesture
object.onBegin
(Gesture.BeginCallback handler) Emitted when the gesture is recognized.onCancel
(Gesture.CancelCallback handler) Emitted whenever a sequence is cancelled.onEnd
(Gesture.EndCallback handler) Emitted whengesture
either stopped recognizing the event sequences as something to be handled, or the number of touch sequences became higher or lower thanGtk.Gesture:n-points
.Emitted whenever a sequence state changes.onUpdate
(Gesture.UpdateCallback handler) Emitted whenever an event is handled while the gesture is recognized.setNPoints
(int nPoints) The number of touch points that trigger recognition on this gesture.Methods inherited from class org.gnome.gtk.EventController.Builder
setName, setPropagationLimit, setPropagationPhase
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 theGesture
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 toGesture
.- Overrides:
build
in classEventController.Builder<B extends Gesture.Builder<B>>
- Returns:
- a new instance of
Gesture
with the properties that were set in the Builder object.
-
setNPoints
The number of touch points that trigger recognition on this gesture.- Parameters:
nPoints
- the value for then-points
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
onBegin
Emitted when the gesture is recognized.This means the number of touch sequences matches
Gtk.Gesture:n-points
.Note: These conditions may also happen when an extra touch (eg. a third touch on a 2-touches gesture) is lifted, in that situation
sequence
won't pertain to the current set of active touches, so don't rely on this being true.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onCancel
Emitted whenever a sequence is cancelled.This usually happens on active touches when
EventController.reset()
is called ongesture
(manually, due to grabs...), or the individualsequence
was claimed by parent widgets' controllers (seeGesture.setSequenceState(org.gnome.gdk.EventSequence, org.gnome.gtk.EventSequenceState)
).gesture
must forget everything aboutsequence
as in response to this signal.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onEnd
Emitted whengesture
either stopped recognizing the event sequences as something to be handled, or the number of touch sequences became higher or lower thanGtk.Gesture:n-points
.Note:
sequence
might not pertain to the group of sequences that were previously triggering recognition ongesture
(ie. a just pressed touch sequence that exceedsGtk.Gesture:n-points
). This situation may be detected by checking throughGesture.handlesSequence(org.gnome.gdk.EventSequence)
.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onSequenceStateChanged
Emitted whenever a sequence state changes.See
Gesture.setSequenceState(org.gnome.gdk.EventSequence, org.gnome.gtk.EventSequenceState)
to know more about the expectable sequence lifetimes.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-
onUpdate
Emitted whenever an event is handled while the gesture is recognized.sequence
is guaranteed to pertain to the set of active touches.- Parameters:
handler
- the signal handler- Returns:
- the
Builder
instance is returned, to allow method chaining - See Also:
-