org.graffiti.plugin.view.interactive
Class UserGestureDispatcher

java.lang.Object
  extended by org.graffiti.plugin.view.interactive.UserGestureDispatcher
All Implemented Interfaces:
UserGestureListener

public class UserGestureDispatcher
extends Object
implements UserGestureListener

A UserGestureDispatcher receives UserGestures and broadcasts them to interested listeners.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Constructor Summary
UserGestureDispatcher()
          Constructs a UserGestureDispatcher.
 
Method Summary
 void addListener(UserGestureListener listener)
          Adds the specified UserGestureListener listener, which will be notified when a user gesture is performed.
 void canceled(InteractiveView<?> source)
          Is called when the user canceled a sequence of user gestures.
 void gesturePerformed(InteractiveView<?> source, UserGesture gesture)
          Is called when a user gesture occurs in a view.
 void removeListener(UserGestureListener listener)
          Removes the first occurrence of the specified listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserGestureDispatcher

public UserGestureDispatcher()
Constructs a UserGestureDispatcher.

Method Detail

addListener

public void addListener(UserGestureListener listener)
Adds the specified UserGestureListener listener, which will be notified when a user gesture is performed. If a listener is added multiple times, it will be notified accordingly multiple times in response to each single user gesture.

Parameters:
listener - the listener to add.

removeListener

public void removeListener(UserGestureListener listener)
Removes the first occurrence of the specified listener.

Parameters:
listener - the listener to remove.

gesturePerformed

public void gesturePerformed(InteractiveView<?> source,
                             UserGesture gesture)
Is called when a user gesture occurs in a view. Calls UserGestureListener.gesturePerformed(InteractiveView, UserGesture) on each listener that was previously added to this dispatcher. If a listener was added multiple times, it will be notified accordingly multiple times.

Specified by:
gesturePerformed in interface UserGestureListener
Parameters:
source - the view the user gesture occurred in.
gesture - the user gesture that was performed.

canceled

public void canceled(InteractiveView<?> source)
Is called when the user canceled a sequence of user gestures. Calls UserGestureListener.canceled(InteractiveView) on each listener that was previously added to this dispatcher. If a listener was added multiple times, it will be notified accordingly multiple times.

Specified by:
canceled in interface UserGestureListener
Parameters:
source - the currently active view.


Generated at 2012-05-30 11:00:36 PM CEST