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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Finish building theGestureobject.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 whengestureeither 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, setPropagationPhaseMethods inherited from class org.gnome.gobject.GObject.Builder
onNotifyMethods inherited from class org.javagi.gobject.Builder
addBuilderProperty, connect, connect, connectSignals, getArena, getNames, getValues
-
Constructor Details
-
Builder
protected Builder()Default constructor for aBuilderobject.
-
-
Method Details
-
build
Finish building theGestureobject. 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:
buildin classEventController.Builder<B extends Gesture.Builder<B>>- Returns:
- a new instance of
Gesturewith 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-pointsproperty- Returns:
- the
Builderinstance 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
sequencewon't pertain to the current set of active touches, so don't rely on this being true.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance 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 individualsequencewas claimed by parent widgets' controllers (seeGesture.setSequenceState(org.gnome.gdk.EventSequence, org.gnome.gtk.EventSequenceState)).gesturemust forget everything aboutsequenceas in response to this signal.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-
onEnd
Emitted whengestureeither 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:
sequencemight 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
Builderinstance 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
Builderinstance is returned, to allow method chaining - See Also:
-
onUpdate
Emitted whenever an event is handled while the gesture is recognized.sequenceis guaranteed to pertain to the set of active touches.- Parameters:
handler- the signal handler- Returns:
- the
Builderinstance is returned, to allow method chaining - See Also:
-