|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.co.keang.swingaddons.Gesture
public class Gesture
Recognises gestures and notifies listeners. Compound gestures are also recognised, although by default this feature is disabled. Two notification mechanisms are supported. 1. Basic Listener registration and notification. 2. A mapping of Gesture types to an ID and a mapping from the ID to an Action Object.
Nested Class Summary | |
---|---|
static class |
Gesture.Direction
|
Constructor Summary | |
---|---|
Gesture()
|
Method Summary | |
---|---|
void |
addAction(java.lang.String name,
java.awt.event.ActionListener act)
Adds an action with this identifier |
void |
addComponent(java.awt.Component c)
Adds a component as a source of gestures |
void |
addGestureActionMapping(Gesture.Direction gesture,
java.lang.String name)
Adds a gesture mapping |
void |
addGestureActionMapping(java.util.List<Gesture.Direction> gesture,
java.lang.String name)
Adds a gesture mapping |
void |
addGestureListener(IGestureListener listener)
Adds a listener of Gestures |
int |
getMinMovement()
Gets the minimum movement required to generate a gesture |
boolean |
isCompoundEnabled()
Gets the compound gesture enabled state |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent event)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
removeAction(java.lang.String name)
Removes an action with this identifier |
void |
removeAllActionMapping()
Removes all gesture mappings |
void |
removeAllGestureMapping()
Removes all gesture mappings |
void |
removeComponent(java.awt.Component c)
Remove a component as a source of gestures |
void |
removeGestureActionMapping(java.util.List<Gesture.Direction> g)
Removes a gesture mapping |
void |
removeGestureActionMapping(java.lang.String name)
Removes a gesture mapping |
void |
removeGestureListener(IGestureListener listener)
Removes a listener of Gestures |
void |
setCompoundEnabled(boolean state)
Sets the compound gestures enabled state. |
void |
setEnabled(boolean state)
Sets the enabled state of the gesture handler |
void |
setMinMovement(int min)
Sets the minimum movement required to generate a gesture |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Gesture()
Method Detail |
---|
public void addComponent(java.awt.Component c)
c
- - the source componentpublic void removeComponent(java.awt.Component c)
c
- - the source componentpublic void addGestureListener(IGestureListener listener)
listener
- - the listener to addpublic void removeGestureListener(IGestureListener listener)
listener
- - the listener to addpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public int getMinMovement()
public void setMinMovement(int min)
min
- - the minMovement in pixelspublic void setEnabled(boolean state)
state
- - true to enable gesture recognitionpublic void addAction(java.lang.String name, java.awt.event.ActionListener act)
name
- - the idact
- - the actionpublic void removeAction(java.lang.String name)
name
- - the idpublic void removeAllActionMapping()
public void addGestureActionMapping(Gesture.Direction gesture, java.lang.String name)
gesture
- - the gesturename
- - the action idpublic void addGestureActionMapping(java.util.List<Gesture.Direction> gesture, java.lang.String name)
gesture
- - the compound gesturename
- - the action idpublic void removeGestureActionMapping(java.util.List<Gesture.Direction> g)
g
- - the gesturepublic void removeGestureActionMapping(java.lang.String name)
name
- - the action idpublic void removeAllGestureMapping()
public boolean isCompoundEnabled()
public void setCompoundEnabled(boolean state)
state
- true to allow compound gestures to be detected
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |