JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.newt.event.PinchToZoomGesture Class Reference

2 pointer zoom, a.k.a. More...

Inheritance diagram for com.jogamp.newt.event.PinchToZoomGesture:
Collaboration diagram for com.jogamp.newt.event.PinchToZoomGesture:

Classes

class  ZoomEvent
 A GestureHandler.GestureEvent denominating zoom. More...
 

Public Member Functions

 PinchToZoomGesture (final NativeSurface surface, final boolean allowMorePointer)
 
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 getZoom ()
 Zoom value lies within [0..2], with 1 as 1:1. More...
 
final void setZoom (final float zoom)
 Set zoom value within [0..2], with 1 as 1:1. More...
 
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 boolean DEBUG = Debug.debug("Window.MouseEvent")
 
- Static Public Attributes inherited from com.jogamp.newt.event.GestureHandler
static final boolean DEBUG = Debug.debug("Window.MouseEvent")
 

Detailed Description

2 pointer zoom, a.k.a.

pinch to zoom, gesture handler processing MouseEvents while producing ZoomEvents if gesture is completed.

Zoom value lies within [0..2], with 1 as 1:1.

  • choosing the smallest surface edge (width/height -> x/y)
  • tolerating other fingers to be pressed and hence user to add functionality (scale, ..)

Definition at line 47 of file PinchToZoomGesture.java.

Constructor & Destructor Documentation

◆ PinchToZoomGesture()

com.jogamp.newt.event.PinchToZoomGesture.PinchToZoomGesture ( final NativeSurface  surface,
final boolean  allowMorePointer 
)
Parameters
surfacethe NativeSurface, which size is used to compute the relative zoom factor
allowMorePointerif false, allow only 2 pressed pointers (safe and recommended), otherwise accept other pointer to be pressed.

Definition at line 101 of file PinchToZoomGesture.java.

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void com.jogamp.newt.event.PinchToZoomGesture.clear ( final boolean  clearStarted)

Clears state of handler, i.e.

resets all states incl. previous detected gesture.

Parameters
clearStartedif 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 127 of file PinchToZoomGesture.java.

Here is the caller graph for this function:

◆ getGestureEvent()

InputEvent com.jogamp.newt.event.PinchToZoomGesture.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 149 of file PinchToZoomGesture.java.

◆ getZoom()

final float com.jogamp.newt.event.PinchToZoomGesture.getZoom ( )

Zoom value lies within [0..2], with 1 as 1:1.

Definition at line 154 of file PinchToZoomGesture.java.

◆ hasGesture()

boolean com.jogamp.newt.event.PinchToZoomGesture.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 144 of file PinchToZoomGesture.java.

◆ isWithinGesture()

boolean com.jogamp.newt.event.PinchToZoomGesture.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 139 of file PinchToZoomGesture.java.

Here is the caller graph for this function:

◆ process()

boolean com.jogamp.newt.event.PinchToZoomGesture.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 163 of file PinchToZoomGesture.java.

Here is the call graph for this function:

◆ setZoom()

final void com.jogamp.newt.event.PinchToZoomGesture.setZoom ( final float  zoom)

Set zoom value within [0..2], with 1 as 1:1.

Definition at line 158 of file PinchToZoomGesture.java.

◆ toString()

String com.jogamp.newt.event.PinchToZoomGesture.toString ( )

Definition at line 109 of file PinchToZoomGesture.java.

Here is the call graph for this function:

Member Data Documentation

◆ DEBUG

final boolean com.jogamp.newt.event.PinchToZoomGesture.DEBUG = Debug.debug("Window.MouseEvent")
static

Definition at line 48 of file PinchToZoomGesture.java.


The documentation for this class was generated from the following file: