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, ..)
| Modifier and Type | Class and Description |
|---|---|
| public static class | PinchToZoomGesture.
A |
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| public static final boolean | |
| private final short[] | |
| private final NativeSurface | |
| private float | |
| private PinchToZoomGesture. | |
| private boolean | |
| private int | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | PinchToZoomGesture(final NativeSurface
the surface, final boolean NativeSurface, which size is used to compute the relative zoom factorif false, allow only 2 pressed pointers (safe and recommended), otherwise accept other pointer to be pressed. allowMorePointer)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | clear(final boolean
if true, also clears clearStarted)started state,
otherwise stay within gesture - if appropriate.
Staying within a gesture allows fluent continuous gesture sequence,
e.g. for scrolling.Implements com. |
| private int | |
| public InputEvent | getGestureEvent()
Implements com. InputEvent for the gesture as detected by
a previous process(InputEvent), which has not been cleared.
|
| public final float | |
| public boolean | hasGesture()
Implements com. process(InputEvent) command produced a gesture,
which has not been cleared.
|
| public boolean | isWithinGesture()
Implements com. process(InputEvent) command,
which has not been cleared.
|
| public boolean | process(final InputEvent in)
Implements com. InputEvent and returns true if it produced the gesture.
|
| public final void | |
| public String |
| allowMorePointer | back to summary |
|---|---|
| private final boolean allowMorePointer | |
| DEBUG | back to summary |
|---|---|
| public static final boolean DEBUG | |
| pIds | back to summary |
|---|---|
| private final short[] pIds | |
| surface | back to summary |
|---|---|
| private final NativeSurface surface | |
| zoom | back to summary |
|---|---|
| private float zoom | |
| zoomEvent | back to summary |
|---|---|
| private PinchToZoomGesture. | |
| zoomFirstTouch | back to summary |
|---|---|
| private boolean zoomFirstTouch | |
| zoomLastEdgeDist | back to summary |
|---|---|
| private int zoomLastEdgeDist | |
| zoomMode | back to summary |
|---|---|
| private boolean zoomMode | |
| PinchToZoomGesture | back to summary |
|---|---|
public PinchToZoomGesture(final NativeSurface surface, final boolean allowMorePointer)
| |
| clear | back to summary |
|---|---|
| public void clear(final boolean clearStarted) Implements com. Doc from com. Clears state of handler, i.e. resets all states incl. previous detected gesture. | |
| gesturePointers | back to summary |
|---|---|
| private int gesturePointers(final MouseEvent e, final int excludeIndex) | |
| getGestureEvent | back to summary |
|---|---|
| public InputEvent getGestureEvent() Implements com. Doc from com. Returns the corresponding
Only implemented for gestures mapping to
| |
| getZoom | back to summary |
|---|---|
| public final float getZoom() Zoom value lies within [0..2], with 1 as 1:1. | |
| hasGesture | back to summary |
|---|---|
| public boolean hasGesture() Implements com. Doc from com. Returns true if a previous
| |
| isWithinGesture | back to summary |
|---|---|
| public boolean isWithinGesture() Implements com. Doc from com. Returns true if within a gesture as detected by a previous
| |
| process | back to summary |
|---|---|
| public boolean process(final InputEvent in) Implements com. Doc from com. Process the given 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
| |
| setZoom | back to summary |
|---|---|
| public final void setZoom(final float zoom) Set zoom value within [0..2], with 1 as 1:1. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
GestureHandler.GestureEvent denominating zoom.
| Modifier and Type | Field and Description |
|---|---|
| private final float | |
| private final float | |
| private final float |
| Access | Constructor and Description |
|---|---|
| public | ZoomEvent(final Object source, final long when, final int modifiers, final GestureHandler handler, final MouseEvent pe, final float zoom, final float delta, final float scale)
|
| Modifier and Type | Method and Description |
|---|---|
| public final float | |
| public final float | getScale()
Returns the scale used to determine the |
| public final float | |
| public final String | toString()
Overrides com. |
| delta | back to summary |
|---|---|
| private final float delta | |
| scale | back to summary |
|---|---|
| private final float scale | |
| zoom | back to summary |
|---|---|
| private final float zoom | |
| ZoomEvent | back to summary |
|---|---|
| public ZoomEvent(final Object source, final long when, final int modifiers, final GestureHandler handler, final MouseEvent pe, final float zoom, final float delta, final float scale) | |
| getDelta | back to summary |
|---|---|
| public final float getDelta() Delta to last zoom value lies within [-1..1]. | |
| getScale | back to summary |
|---|---|
| public final float getScale() Returns the scale used to determine the
For
For | |
| getZoom | back to summary |
|---|---|
| public final float getZoom() Zoom value lies within [0..2], with 1 as 1:1. | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides com. Doc from java. Returns a String representation of this EventObject.
| |