Errai 3.0.1-SNAPSHOT

org.jboss.errai.ui.cordova.events.touch.pinch
Class PinchEvent

java.lang.Object
  extended by com.google.web.bindery.event.shared.Event<H>
      extended by com.google.gwt.event.shared.GwtEvent<PinchHandler>
          extended by 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 Class Summary
 
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
 
Method Summary
protected  void dispatch(PinchHandler handler)
           
 com.google.gwt.event.shared.GwtEvent.Type<PinchHandler> getAssociatedType()
           
 double getScaleFactor()
          the new scale factor that can be applied for getting a zoom effect
static com.google.gwt.event.shared.GwtEvent.Type<PinchHandler> getType()
           
 int getX()
          The x position of the center point of the pinch.
 int getY()
          The y position of the center point of the pinch.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PinchEvent

public PinchEvent(int x,
                  int y,
                  double scaleFactor)
Construct a pinch event

Parameters:
x - the mid point of the pinch in x
y - the mid point of the pinch in y
scaleFactor - the new scaling factor
Method Detail

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

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.