© 2006-2007 ETH Zurich

org.ximtec.igesture.core.composite
Class SequenceConstraint

java.lang.Object
  extended by org.ximtec.igesture.core.DefaultPropertyChangeNotifier
      extended by org.ximtec.igesture.core.DefaultDataObject
          extended by org.ximtec.igesture.core.composite.DefaultConstraint
              extended by org.ximtec.igesture.core.composite.SequenceConstraint
All Implemented Interfaces:
Serializable, Constraint, DataObject, PropertyChangeNotifier
Direct Known Subclasses:
ProximitySequenceConstraint

public class SequenceConstraint
extends DefaultConstraint

This class represents a sequence constraint. All gestures have to be performed in the order they were defined. A minimum and a maximum time interval between two consecutive gestures has to be defined.

Author:
Bjorn Puype, bpuype@gmail.com
See Also:
Serialized Form

Nested Class Summary
static class SequenceConstraint.Config
           
 
Field Summary
 
Fields inherited from class org.ximtec.igesture.core.composite.DefaultConstraint
DEFAULT_CONFIGURATION, df, gestures, gestureTime, processingTime, PROPERTY_GESTURES, setterMapping
 
Fields inherited from class org.ximtec.igesture.core.DefaultDataObject
PROPERTY_ID
 
Fields inherited from class org.ximtec.igesture.core.DefaultPropertyChangeNotifier
propertyChangeSupport
 
Constructor Summary
SequenceConstraint()
           
 
Method Summary
 Map<String,Calendar> determineTimeWindows()
          Determine the time window for each composing gesture.
 Set<String> generatePatterns(Map<String,String> charMapping)
          Generate all possible string patterns that represent the composite gesture.
 Calendar getMaxTime()
          Get the maximum time between two gestures
 Calendar getMinTime()
          Get the minimum time between two gestures
 void setMaxTime(String time)
          Set the maximum time between two gestures
 void setMinTime(String time)
          Set the minimum time between two gestures
 String toString()
           
 boolean validateConditions(List<Gesture<?>> gestures, IDeviceManager manager)
          Validate the constraint conditions.
 
Methods inherited from class org.ximtec.igesture.core.composite.DefaultConstraint
addGestureClass, addGestureClass, addGestureClass, addGestureClass, getDistinctGestureClasses, getGestureClasses, getGestureEntries, getGestureTime, getNumberOfGestures, getParameter, getParameters, getTimeStamp, removeAllGestureClasses, removeGestureClass, setGestureTime, setParameter
 
Methods inherited from class org.ximtec.igesture.core.DefaultDataObject
accept, getId, setId
 
Methods inherited from class org.ximtec.igesture.core.DefaultPropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ximtec.igesture.core.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

SequenceConstraint

public SequenceConstraint()
Method Detail

setMinTime

public void setMinTime(String time)
                throws ParseException
Set the minimum time between two gestures

Parameters:
time - minimum time in format "hh:mm:ss.SSS"
Throws:
ParseException - thrown if the minimum time could not be parsed

setMaxTime

public void setMaxTime(String time)
                throws ParseException
Set the maximum time between two gestures

Parameters:
time - maximum time in format "hh:mm:ss.SSS"
Throws:
ParseException - thrown if the maximum time could not be parsed

getMinTime

public Calendar getMinTime()
Get the minimum time between two gestures


getMaxTime

public Calendar getMaxTime()
Get the maximum time between two gestures


determineTimeWindows

public Map<String,Calendar> determineTimeWindows()
Description copied from interface: Constraint
Determine the time window for each composing gesture.

Specified by:
determineTimeWindows in interface Constraint
Specified by:
determineTimeWindows in class DefaultConstraint
Returns:
Mapping between the gesture name and the corresponding time window.

generatePatterns

public Set<String> generatePatterns(Map<String,String> charMapping)
Description copied from interface: Constraint
Generate all possible string patterns that represent the composite gesture.

Specified by:
generatePatterns in interface Constraint
Specified by:
generatePatterns in class DefaultConstraint
Parameters:
charMapping - Mapping between the gesture class name and the character representation

validateConditions

public boolean validateConditions(List<Gesture<?>> gestures,
                                  IDeviceManager manager)
Description copied from interface: Constraint
Validate the constraint conditions.

Specified by:
validateConditions in interface Constraint
Overrides:
validateConditions in class DefaultConstraint
Parameters:
gestures - Gestures that possibly compose the composite gesture.
manager - Device manager to check the associated users.
Returns:

toString

public String toString()
Specified by:
toString in interface Constraint
Overrides:
toString in class DefaultConstraint

© 2006-2007 ETH Zurich

Copyright © 2007-2010 Global Information Systems Group, ETH Zurich. All Rights Reserved.