|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.silentlycrashing.gestures.GestureListener
public abstract class GestureListener
Listens for a specific gesture and calls the appropriate RegisteredAction when it becomes active or inactive.
| Field Summary | |
|---|---|
protected boolean |
active
|
protected Rectangle |
bounds
|
protected GestureAnalyzer |
ga
|
protected boolean |
inBounds
|
protected RegisteredAction |
offAction
|
protected RegisteredAction |
onAction
|
protected PApplet |
p
|
protected PointInTime |
startPoint
|
| Constructor Summary | |
|---|---|
GestureListener(PApplet parent,
GestureAnalyzer analyzer)
Builds a GestureListener covering the entire canvas. |
|
GestureListener(PApplet parent,
GestureAnalyzer analyzer,
Rectangle bounds)
Builds a bounded GestureListener. |
|
| Method Summary | |
|---|---|
void |
activate()
|
void |
deactivate()
|
PointInTime |
getStartPoint()
|
boolean |
isActive()
|
abstract void |
keepListening(PointInTime pt)
Holds actions to be performed when a new move occurs in the gesture. |
void |
registerOffAction(String name,
Object o)
Registers the given method with the off action. |
void |
registerOnAction(String name,
Object o)
Registers the given method with the on action. |
void |
setBounds(Rectangle newBounds)
|
void |
startListening(PointInTime pt)
Checks that the gesture is starting in the correct bounds and sets the start point. |
abstract void |
stopListening(PointInTime pt)
Holds actions to be performed when a gesture completes. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PApplet p
protected GestureAnalyzer ga
protected boolean active
protected RegisteredAction onAction
protected RegisteredAction offAction
protected PointInTime startPoint
protected Rectangle bounds
protected boolean inBounds
| Constructor Detail |
|---|
public GestureListener(PApplet parent,
GestureAnalyzer analyzer)
parent - the parent PAppletanalyzer - the linked GestureAnalyzer
public GestureListener(PApplet parent,
GestureAnalyzer analyzer,
Rectangle bounds)
parent - the parent PAppletanalyzer - the linked GestureAnalyzerbounds - the bounding Rectangle of the first mouse press| Method Detail |
|---|
public void startListening(PointInTime pt)
pt - the first PointInTime of the gesturepublic abstract void keepListening(PointInTime pt)
pt - the current PointInTime of the gesturepublic abstract void stopListening(PointInTime pt)
pt - the last PointInTime of the gesture
public void registerOnAction(String name,
Object o)
name - the name of the method to registero - the Object holding the method
public void registerOffAction(String name,
Object o)
name - the name of the method to registero - the Object holding the methodpublic void activate()
public void deactivate()
public boolean isActive()
public PointInTime getStartPoint()
public void setBounds(Rectangle newBounds)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||