rubine
Class GestureStateMachine

java.lang.Object
  extended bysm.StateMachine
      extended byrubine.GestureStateMachine
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class GestureStateMachine
extends StateMachine

A state machine that can be associated with a classifier to receive gesture events.

Author:
Caroline Appert

Nested Class Summary
 
Nested classes inherited from class sm.StateMachine
StateMachine.State
 
Constructor Summary
GestureStateMachine(java.lang.String n)
          Builds a state machine.
GestureStateMachine(java.lang.String n, SMCanvas c)
          Builds a state machine and attach it to a canvas.
 
Method Summary
 void gestureDisable()
          Makes this state machine do not receive the gesture events
 void gestureEnable(java.lang.String dictionary)
          Makes this state machine receive the gesture events
 Gesture newGesture()
          Builds a new gesture.
 void processEvent(int modifier, java.awt.geom.Point2D p, Gesture g)
          Classifies a gesture and fires a gesture event to this state machine.
 
Methods inherited from class sm.StateMachine
actionPerformed, addSMListener, armTimer, attachTo, attachTo, consumes, detach, disarmTimer, doReset, doResume, doSuspend, getAllStates, getCurrentState, getName, getObjects, greaterPriorityThan, greatestPriority, hasConsumed, init, isActive, isAttached, isAttachedTo, lowerPriorityThan, lowestPriority, processEvent, processEvent, processEvent, processEvent, removeSMListener, reset, resume, setActive, suspend
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GestureStateMachine

public GestureStateMachine(java.lang.String n)
Builds a state machine. The name of the machine must be unique among all state machines.

Parameters:
n - the name of the state machine.

GestureStateMachine

public GestureStateMachine(java.lang.String n,
                           SMCanvas c)
Builds a state machine and attach it to a canvas. The name of the machine must be unique among all state machines.

Parameters:
n - the name of the state machine.
c - the canvas to link to this state machine.
Method Detail

processEvent

public void processEvent(int modifier,
                         java.awt.geom.Point2D p,
                         Gesture g)
Classifies a gesture and fires a gesture event to this state machine.

Parameters:
modifier - The modifier of this gesture event.
p - The location where this event occured.
g - The gesture The gesture to classify.

gestureEnable

public void gestureEnable(java.lang.String dictionary)
Makes this state machine receive the gesture events

Parameters:
dictionary - The name of the file that contains the definition of the dictionary (classes associated to their learning examples).

gestureDisable

public void gestureDisable()
Makes this state machine do not receive the gesture events


newGesture

public Gesture newGesture()
Builds a new gesture.

Returns:
Returns the newly created gesture.