org.jboss.errai.ui.cordova.events.touch.pinch
Class PinchEvent
java.lang.Object
com.google.web.bindery.event.shared.Event<H>
com.google.gwt.event.shared.GwtEvent<PinchHandler>
org.jboss.errai.ui.cordova.events.touch.pinch.PinchEvent
public class PinchEvent
- extends com.google.gwt.event.shared.GwtEvent<PinchHandler>
A PinchEvent
is fired when a user moves to finger on the display.
A pinch event is fired around a center point which is calculated by looking
at the two fingers producing the event.
if finger one is at x1, y1 and finger two is at x2, y2 the center point is
(x1 + x2) / 2 and (y1 + y2) / 2
- Author:
- Daniel Kurka
Nested classes/interfaces inherited from class com.google.gwt.event.shared.GwtEvent |
com.google.gwt.event.shared.GwtEvent.Type<H> |
Constructor Summary |
PinchEvent(int x,
int y,
double scaleFactor)
Construct a pinch event |
Methods inherited from class com.google.gwt.event.shared.GwtEvent |
assertLive, getSource, isLive, kill, revive |
Methods inherited from class com.google.web.bindery.event.shared.Event |
setSource, toDebugString, toString |
PinchEvent
public PinchEvent(int x,
int y,
double scaleFactor)
- Construct a pinch event
- Parameters:
x
- the mid point of the pinch in xy
- the mid point of the pinch in yscaleFactor
- the new scaling factor
getType
public static com.google.gwt.event.shared.GwtEvent.Type<PinchHandler> getType()
getAssociatedType
public com.google.gwt.event.shared.GwtEvent.Type<PinchHandler> getAssociatedType()
- Overrides:
getAssociatedType
in class com.google.gwt.event.shared.GwtEvent<PinchHandler>
dispatch
protected void dispatch(PinchHandler handler)
- Specified by:
dispatch
in class com.google.gwt.event.shared.GwtEvent<PinchHandler>
getX
public int getX()
- The x position of the center point of the pinch.
- Returns:
- the x position
getY
public int getY()
- The y position of the center point of the pinch.
- Returns:
- the y position
getScaleFactor
public double getScaleFactor()
- the new scale factor that can be applied for getting a zoom effect
- Returns:
- the scale factor
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.