|
JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java (public API).
|
2 pointer scroll/rotate gesture handler processing MouseEvents while producing MouseEvent#EVENT_MOUSE_WHEEL_MOVED events if gesture is completed.
More...
Public Member Functions | |
| DoubleTapScrollGesture (final int scaledScrollSlop, final int scaledDoubleTapSlop) | |
| scaledScrollSlop < scaledDoubleTapSlop More... | |
| String | toString () |
| void | clear (final boolean clearStarted) |
| Clears state of handler, i.e. More... | |
| boolean | isWithinGesture () |
Returns true if within a gesture as detected by a previous process(InputEvent) command, which has not been cleared. More... | |
| boolean | hasGesture () |
Returns true if a previous process(InputEvent) command produced a gesture, which has not been cleared. More... | |
| InputEvent | getGestureEvent () |
Returns the corresponding InputEvent for the gesture as detected by a previous process(InputEvent), which has not been cleared. More... | |
| final float[] | getScrollDistanceXY () |
| boolean | process (final InputEvent in) |
Process the given InputEvent and returns true if it produced the gesture. More... | |
| void | clear (boolean clearStarted) |
| Clears state of handler, i.e. More... | |
| boolean | hasGesture () |
Returns true if a previous process(InputEvent) command produced a gesture, which has not been cleared. More... | |
| InputEvent | getGestureEvent () |
Returns the corresponding InputEvent for the gesture as detected by a previous process(InputEvent), which has not been cleared. More... | |
| boolean | isWithinGesture () |
Returns true if within a gesture as detected by a previous process(InputEvent) command, which has not been cleared. More... | |
| boolean | process (InputEvent e) |
Process the given InputEvent and returns true if it produced the gesture. More... | |
Static Public Attributes | |
| static final int | SCROLL_SLOP_PIXEL |
| Scroll threshold in pixels (fallback), defaults to 16 pixels. More... | |
| static final int | DOUBLE_TAP_SLOP_PIXEL |
| Two pointer 'double tap' slop in pixels (fallback), defaults to 104 pixels. More... | |
| static final float | SCROLL_SLOP_MM |
| Scroll threshold in millimeter, defaults to 3 mm. More... | |
| static final float | DOUBLE_TAP_SLOP_MM |
| Two pointer 'double tap' slop in millimeter, defaults to 20 mm. More... | |
Static Public Attributes inherited from com.jogamp.newt.event.GestureHandler | |
| static final boolean | DEBUG = Debug.debug("Window.MouseEvent") |
2 pointer scroll/rotate gesture handler processing MouseEvents while producing MouseEvent#EVENT_MOUSE_WHEEL_MOVED events if gesture is completed.
Criteria related to parameters:
doubleTapSlop (scaled in pixels):
Implementation uses a n-state to get detect gesture:
| from | to | action |
|---|---|---|
| NONE | 1PRESS | 1-pointer-pressed |
| 1PRESS | 2PRESS_T | 2-pointer-pressed within doubleTapSlope |
| 2PRESS_T | SCROLL | 2-pointer dragged, dist-diff within doubleTapSlop and scrollLen >= scrollSlop |
| 2PRESS_C | SCROLL | 2-pointer dragged, dist-diff within doubleTapSlop |
| SCROLL | SCROLL | 2-pointer dragged, dist-diff within doubleTapSlop |
State ST_2PRESS_C merely exist to pick up gesture after one pointer has been lost temporarily.
isWithinGesture() returns gestureState >= 2PRESS_C
Definition at line 74 of file DoubleTapScrollGesture.java.
| com.jogamp.newt.event.DoubleTapScrollGesture.DoubleTapScrollGesture | ( | final int | scaledScrollSlop, |
| final int | scaledDoubleTapSlop | ||
| ) |
scaledScrollSlop < scaledDoubleTapSlop
| scaledScrollSlop | Distance a pointer can wander before we think the user is scrolling in pixels. |
| scaledDoubleTapSlop | Distance in pixels between the first touch and second touch to still be considered a double tap. |
Definition at line 134 of file DoubleTapScrollGesture.java.
| void com.jogamp.newt.event.DoubleTapScrollGesture.clear | ( | final boolean | clearStarted | ) |
Clears state of handler, i.e.
resets all states incl. previous detected gesture.
| clearStarted | if true, also clears started state, otherwise stay within gesture - if appropriate. Staying within a gesture allows fluent continuous gesture sequence, e.g. for scrolling. |
Implements com.jogamp.newt.event.GestureHandler.
Definition at line 153 of file DoubleTapScrollGesture.java.
| InputEvent com.jogamp.newt.event.DoubleTapScrollGesture.getGestureEvent | ( | ) |
Returns the corresponding InputEvent for the gesture as detected by a previous process(InputEvent), which has not been cleared.
Otherwise returns null.
Only implemented for gestures mapping to InputEvents.
Implements com.jogamp.newt.event.GestureHandler.
Definition at line 178 of file DoubleTapScrollGesture.java.
| final float[] com.jogamp.newt.event.DoubleTapScrollGesture.getScrollDistanceXY | ( | ) |
Definition at line 197 of file DoubleTapScrollGesture.java.
| boolean com.jogamp.newt.event.DoubleTapScrollGesture.hasGesture | ( | ) |
Returns true if a previous process(InputEvent) command produced a gesture, which has not been cleared.
Otherwise returns false.
Implements com.jogamp.newt.event.GestureHandler.
Definition at line 173 of file DoubleTapScrollGesture.java.
| boolean com.jogamp.newt.event.DoubleTapScrollGesture.isWithinGesture | ( | ) |
Returns true if within a gesture as detected by a previous process(InputEvent) command, which has not been cleared.
Otherwise returns false.
Implements com.jogamp.newt.event.GestureHandler.
Definition at line 168 of file DoubleTapScrollGesture.java.
| boolean com.jogamp.newt.event.DoubleTapScrollGesture.process | ( | final InputEvent | e | ) |
Process the given InputEvent and returns true if it produced the gesture.
Otherwise returns false.
If a gesture was already detected previously and has not been cleared, method does not process the event and returns true.
Besides validation of the event's details, the handler may also validate the InputEvent.InputClass and/or InputEvent.InputType.
Implements com.jogamp.newt.event.GestureHandler.
Definition at line 202 of file DoubleTapScrollGesture.java.
| String com.jogamp.newt.event.DoubleTapScrollGesture.toString | ( | ) |
Definition at line 148 of file DoubleTapScrollGesture.java.
|
static |
Two pointer 'double tap' slop in millimeter, defaults to 20 mm.
Can be overriden by integer property newt.event.double_tap_slop_mm.
Definition at line 83 of file DoubleTapScrollGesture.java.
|
static |
Two pointer 'double tap' slop in pixels (fallback), defaults to 104 pixels.
Can be overriden by integer property newt.event.double_tap_slop_pixel.
Definition at line 78 of file DoubleTapScrollGesture.java.
|
static |
Scroll threshold in millimeter, defaults to 3 mm.
Can be overriden by integer property newt.event.scroll_slop_mm.
Definition at line 81 of file DoubleTapScrollGesture.java.
|
static |
Scroll threshold in pixels (fallback), defaults to 16 pixels.
Can be overriden by integer property newt.event.scroll_slop_pixel.
Definition at line 76 of file DoubleTapScrollGesture.java.