com.nokia.mid.ui.gestures
Interface GestureEvent


public interface GestureEvent

The GestureEvent interface class is used by an application to receive gesture recognition events from the platform.

The API imposes the restriction that the gesture event data is only valid during the call to GestureListener.gestureAction(java.lang.Object, com.nokia.mid.ui.gestures.GestureInteractiveZone, com.nokia.mid.ui.gestures.GestureEvent).


Method Summary
 int getDragDistanceX()
          Query for the Drag & Drop gesture events movement in horizontal direction since last drag gesture.
 int getDragDistanceY()
          Query for the Drag & Drop gesture events movement in vertical direction since last drag gesture.
 float getFlickDirection()
          Query for the Flick gesture events direction.
 int getFlickSpeed()
          Query for the Flick gesture events speed in actual flick direction.
 int getFlickSpeedX()
          Query for the Flick gesture events speed in horizontal direction.
 int getFlickSpeedY()
          Query for the Flick gesture events speed in vertical direction.
 int getStartX()
          Query for the gestures horizontal start location.
 int getStartY()
          Query for the gestures vertical start location.
 int getType()
          Query for the actual gesture event that has occurred.
 

Method Detail

getType

int getType()

Query for the actual gesture event that has occurred.

Gesture Event can be one of:

Returns:
gesture event that has just occurred.

getDragDistanceX

int getDragDistanceX()

Query for the Drag & Drop gesture events movement in horizontal direction since last drag gesture.

This method can only be called for drag GestureInteractiveZone.GESTURE_DRAG and drop GestureInteractiveZone.GESTURE_DROP gesture events.

Returns:
movement in horizontal direction in pixels since last drag event.
Throws:
java.lang.IllegalStateException - if requested data invalid for gesture event.

getDragDistanceY

int getDragDistanceY()

Query for the Drag & Drop gesture events movement in vertical direction since last drag gesture.

This method can only be called for drag GestureInteractiveZone.GESTURE_DRAG and drop GestureInteractiveZone.GESTURE_DROP gesture events.

Returns:
movement in vertical direction in pixels since last drag event.
Throws:
java.lang.IllegalStateException - if requested data invalid for gesture event.

getStartX

int getStartX()

Query for the gestures horizontal start location.

This method can be called for all gesture events.

Returns:
horizontal start location of the gesture event relative to the containers origin.

getStartY

int getStartY()

Query for the gestures vertical start location.

This method can be called for all gesture events.

Returns:
vertical start location of the gesture event relative to the containers origin.

getFlickDirection

float getFlickDirection()

Query for the Flick gesture events direction.

This method can only be called for the flick GestureInteractiveZone.GESTURE_FLICK gesture event.

Returns:
flick direction angle in radians.
Throws:
java.lang.IllegalStateException - if requested data invalid for gesture event.

getFlickSpeed

int getFlickSpeed()

Query for the Flick gesture events speed in actual flick direction.

This method can only be called for the flick GestureInteractiveZone.GESTURE_FLICK gesture event.

Returns:
flick speed in pixels per second in actual flick direction.
Throws:
java.lang.IllegalStateException - if requested data invalid for gesture event.

getFlickSpeedX

int getFlickSpeedX()

Query for the Flick gesture events speed in horizontal direction.

This method can only be called for the flick GestureInteractiveZone.GESTURE_FLICK gesture event.

Returns:
flick speed in pixels per second in horizontal direction.
Throws:
java.lang.IllegalStateException - if requested data invalid for gesture event.

getFlickSpeedY

int getFlickSpeedY()

Query for the Flick gesture events speed in vertical direction.

This method can only be called for the flick GestureInteractiveZone.GESTURE_FLICK gesture event.

Returns:
flick speed in pixels per second in vertical direction.
Throws:
java.lang.IllegalStateException - if requested data invalid for gesture event.


Copyright © 2010 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. Other product and company names mentioned herein may be trademarks or trade names of their respective owners. This document is confidential information of Nokia Corporation.

Disclaimer
The information in this document is provided "as is," with no warranties whatsoever, including any warranty of merchantability, fitness for any particular purpose, or any warranty otherwise arising out of any proposal, specification, or sample. Furthermore, information provided in this document is preliminary, and may be changed substantially prior to final release.

Nokia Corporation disclaims all liability, including liability for infringement of any proprietary rights, relating to this document and implementation of any information presented in this document.

Nokia Corporation retains the right to make changes to this document at any time, without notice.

License
Subject to above disclaimer, a license is hereby granted to use this documentation solely under existing Limited License Agreement and non-disclosure agreement between the companies for the agreed application development for Series 40 Nokia phones. No other licenses e.g. to any intellectual property rights are granted herein. Any use of the screen shots of this documentation, including any icons thereof, is subject to Nokia's prior written approval.