com.nokia.mid.ui.gestures
Class GestureRegistrationManager

java.lang.Object
  extended by com.nokia.mid.ui.gestures.GestureRegistrationManager

public class GestureRegistrationManager
extends java.lang.Object

The GestureRegistrationManager class provides the ability to register a GestureListener to be notified when a gesture event occurs within a container. The application must specify the container; a listener instance and the gestures that it wants to be notified about.

The API does not place any restriction on the order that setListener and register are called.

See GestureInteractiveZone for further details on defining receivable gestures.


Field Summary
static int MAX_SUPPORTED_GESTURE_INTERACTIVE_ZONES
          Constant for the maximum number of supported gesture interactive zones per container.
 
Method Summary
static GestureInteractiveZone getInteractiveZone(java.lang.Object container)
          Get the container bound GestureInteractiveZone instance.
static boolean register(java.lang.Object container, GestureInteractiveZone gestureInteractiveZone)
          Register a gesture interactive zone to a container.
static void setListener(java.lang.Object container, GestureListener listener)
          Add a listener to the a container.
static void unregister(java.lang.Object container, GestureInteractiveZone gestureInteractiveZone)
          Unregister a gesture interactive zone from a container.
static void unregisterAll(java.lang.Object container)
          Unregisters all current gesture interactive zones from a container.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_SUPPORTED_GESTURE_INTERACTIVE_ZONES

public static final int MAX_SUPPORTED_GESTURE_INTERACTIVE_ZONES

Constant for the maximum number of supported gesture interactive zones per container.

See Also:
Constant Field Values
Method Detail

setListener

public static void setListener(java.lang.Object container,
                               GestureListener listener)

Add a listener to the a container. A container can be either a Canvas or a CustomItem. Each container can only have one listener associated with it.

Parameters:
container - The container upon which gesture events have occurred.
listener - The listener that is to receive gesture events.
Throws:
java.lang.IllegalArgumentException - if container is null.
java.lang.IllegalArgumentException - if gesture recognition is unsupported on container.

register

public static boolean register(java.lang.Object container,
                               GestureInteractiveZone gestureInteractiveZone)

Register a gesture interactive zone to a container. If the gesture has already been registered the API will silently ignore the new attempt to register the gesture.

Parameters:
container - The container against which the gesture is to be registered.
gestureInteractiveZone - The data defining the gestures to receive and the zone affected.
Returns:
true if Gesture Interactive Zone added, or false if the current number of registered zones exceeds the platform maximum.
Throws:
java.lang.IllegalArgumentException - if container or gestureInteractiveZone is null.
java.lang.IllegalArgumentException - if gesture recognition is unsupported on container.

unregister

public static void unregister(java.lang.Object container,
                              GestureInteractiveZone gestureInteractiveZone)

Unregister a gesture interactive zone from a container. If the gesture has not previously been registered the API will silently ignore the request to unregister it.

Parameters:
container - The container against which the gesture is to be unregistered.
gestureInteractiveZone - The data defining the gestures to receive and the zone affected.
Throws:
java.lang.IllegalArgumentException - if container or gestureInteractiveZone is null.
java.lang.IllegalArgumentException - if gesture recognition is unsupported on container.

unregisterAll

public static void unregisterAll(java.lang.Object container)
Unregisters all current gesture interactive zones from a container.

Parameters:
container - The container from which to unregister the gesture interactive zones.
Throws:
java.lang.IllegalArgumentException - if container is null.
java.lang.IllegalArgumentException - if container is of an unsupported type.

getInteractiveZone

public static GestureInteractiveZone getInteractiveZone(java.lang.Object container)
Get the container bound GestureInteractiveZone instance.

If a container its self is gesture interactive then the container provides a GestureInteractiveZone that is bound to the container's bounding box.

Note 1: calling register(Object, GestureInteractiveZone) or/and unregister(Object, GestureInteractiveZone) will have no effect on such a GestureInteractiveZone instance.

Note 2: The GestureInteractiveZone of a container may only be available after a call to setListener(Object, GestureListener).

Returns:
the container's own GestureInteractiveZone or null if the container does not support this feature.


Copyright © 2012 Nokia Corporation. All rights reserved.

Nokia is registered trademark of Nokia Corporation. Java and all Java-based marks are trademarks or registered trademarks of Oracle Corporation. 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.