com.levigo.jadice.demo.gestures
Class MouseGestureSupport

java.lang.Object
  extended by com.levigo.jadice.demo.gestures.MouseGestureSupport
All Implemented Interfaces:
ModifierActivated

public class MouseGestureSupport
extends Object
implements ModifierActivated

A simple recognizer for mouse gestures. Gestures are recognized from events fed into the MouseEventReceiver created using createEventReceiver(). Gesture recognition starts upon mouse motion events during which the modifier state matches the one set with setActivationModifiers(int) (this defaults to the left mouse button). Recognized gestures consist of strings of N, S, E or W characters with the caracters corresponding to the four cardinal directions north, south, east and west. Gesture candidates are fed to registered MouseGestureListeners.


Constructor Summary
MouseGestureSupport()
           
 
Method Summary
 boolean addMouseGestureListener(MouseGestureListener l)
           
 MouseEventReceiver createEventReceiver()
           
 int getActivationModifiers()
          Get the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to activate this tool.
 int getMinimumSegmentLength()
           
 boolean removeMouseGestureListener(MouseGestureListener l)
           
 void setActivationModifiers(int activationModifiers)
          Set the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to activate this tool.
 void setMinimumSegmentLength(int minimumSegmentLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseGestureSupport

public MouseGestureSupport()
Method Detail

createEventReceiver

public MouseEventReceiver createEventReceiver()

addMouseGestureListener

public boolean addMouseGestureListener(MouseGestureListener l)

removeMouseGestureListener

public boolean removeMouseGestureListener(MouseGestureListener l)

setActivationModifiers

public void setActivationModifiers(int activationModifiers)
Set the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to activate this tool. The modifier mask must be compatible with InputEvent.getModifiersEx(), i.e. it must use the InputEvent constants containing _DOWN_ in their name.

Default: use just the right mouse button.

Specified by:
setActivationModifiers in interface ModifierActivated
See Also:
ModifierActivated.setActivationModifiers(int)

getActivationModifiers

public int getActivationModifiers()
Get the mask of modifier keys (Shift, Control, Alt etc.) and mouse buttons (left, right etc.) to be used to activate this tool.

Specified by:
getActivationModifiers in interface ModifierActivated
Returns:
the modifier and button mask
See Also:
ModifierActivated.setActivationModifiers(int)

setMinimumSegmentLength

public void setMinimumSegmentLength(int minimumSegmentLength)

getMinimumSegmentLength

public int getMinimumSegmentLength()


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.