|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jogamp.newt.event.PinchToZoomGesture
public class PinchToZoomGesture
2 pointer zoom, a.k.a. pinch to zoom, gesture handler processing MouseEvents
while producing PinchToZoomGesture.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, ..)
| Nested Class Summary | |
|---|---|
static class |
PinchToZoomGesture.ZoomEvent
A GestureHandler.GestureEvent denominating zoom. |
| Nested classes/interfaces inherited from interface com.jogamp.newt.event.GestureHandler |
|---|
GestureHandler.GestureEvent, GestureHandler.GestureListener |
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
| Constructor Summary | |
|---|---|
PinchToZoomGesture(NativeSurface surface,
boolean allowMorePointer)
|
|
| Method Summary | |
|---|---|
void |
clear(boolean clearStarted)
Clears state of handler, i.e. |
InputEvent |
getGestureEvent()
Returns the corresponding InputEvent for the gesture as detected by
a previous GestureHandler.process(InputEvent), which has not been cleared. |
float |
getZoom()
Zoom value lies within [0..2], with 1 as 1:1. |
boolean |
hasGesture()
Returns true if a previous GestureHandler.process(InputEvent) command produced a gesture,
which has not been cleared. |
boolean |
isWithinGesture()
Returns true if within a gesture as detected by a previous GestureHandler.process(InputEvent) command,
which has not been cleared. |
boolean |
process(InputEvent in)
Process the given InputEvent and returns true if it produced the gesture. |
void |
setZoom(float zoom)
Set zoom value within [0..2], with 1 as 1:1. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
| Constructor Detail |
|---|
public PinchToZoomGesture(NativeSurface surface,
boolean allowMorePointer)
surface - the NativeSurface, which size is used to compute the relative zoom factorallowMorePointer - if false, allow only 2 pressed pointers (safe and recommended), otherwise accept other pointer to be pressed.| Method Detail |
|---|
public String toString()
toString in class Objectpublic void clear(boolean clearStarted)
GestureHandler
clear in interface GestureHandlerclearStarted - 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.public boolean isWithinGesture()
GestureHandlerGestureHandler.process(InputEvent) command,
which has not been cleared.
Otherwise returns false.
isWithinGesture in interface GestureHandlerpublic boolean hasGesture()
GestureHandlerGestureHandler.process(InputEvent) command produced a gesture,
which has not been cleared.
Otherwise returns false.
hasGesture in interface GestureHandlerpublic InputEvent getGestureEvent()
GestureHandlerInputEvent for the gesture as detected by
a previous GestureHandler.process(InputEvent), which has not been cleared.
Otherwise returns null.
Only implemented for gestures mapping to InputEvents.
getGestureEvent in interface GestureHandlerpublic final float getZoom()
public final void setZoom(float zoom)
public boolean process(InputEvent in)
GestureHandlerInputEvent 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.
process in interface GestureHandler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||