© 2006-2007 ETH Zurich

org.ximtec.igesture.core.composite
Interface Constraint

All Known Implementing Classes:
CardinalityDeviceConstraint, CardinalityUserConstraint, ConcurrencyConstraint, DefaultConstraint, IntervalConstraint, ProximityConcurrencyConstraint, ProximitySequenceConstraint, SequenceConstraint

public interface Constraint

Constraint for a composite gesture. If a composite gesture contains two or more times the same simple gestures, you MUST call the necessary add methods for one simple after each other to get correct results.

Author:
Bjorn Puype, bpuype@gmail.com

Method Summary
 void addGestureClass(String gestureClass)
          Add a gesture class to the composite gesture.
 void addGestureClass(String gestureClass, int user)
          Add a gesture class to the composite gesture and specify the user that performs it.
 void addGestureClass(String gestureClass, int user, String deviceType, Set<String> devices)
          Add a gesture class to the composite gesture and specify the user and the device type used to perform it.
 void addGestureClass(String gestureClass, String deviceType, Set<String> devices)
          Add a gesture class to the composite gesture and specify the device type used to perform it.
 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.
 Set<String> getDistinctGestureClasses()
          Get the disctinct gesture classes that compose this composite gesture
 List<String> getGestureClasses()
          Get all the names of the gesture classes that compose this composite gesture
 List<DefaultConstraintEntry> getGestureEntries()
          Get all gesture entries.
 int getNumberOfGestures()
          Get the number of composing gestures
 String getParameter(String property)
           
 Map<String,String> getParameters()
          Returns an array of containing the constraint parameters.
 void removeAllGestureClasses()
          Remove all gesture classes from the composite.
 void removeGestureClass(DefaultConstraintEntry entry)
          Removes the specified gesture class from the composite.
 void setParameter(String property, String value)
           
 String toString()
           
 boolean validateConditions(List<Gesture<?>> gestures, IDeviceManager manager)
          Validate the constraint conditions.
 

Method Detail

addGestureClass

void addGestureClass(String gestureClass)
                     throws IllegalArgumentException
Add a gesture class to the composite gesture. Note: All users and devices are allowed to perform the gesture.

Throws:
IllegalArgumentException

addGestureClass

void addGestureClass(String gestureClass,
                     int user)
                     throws IllegalArgumentException
Add a gesture class to the composite gesture and specify the user that performs it. Note: All devices are allowed to perform the gesture.

Throws:
IllegalArgumentException

addGestureClass

void addGestureClass(String gestureClass,
                     String deviceType,
                     Set<String> devices)
                     throws IllegalArgumentException
Add a gesture class to the composite gesture and specify the device type used to perform it. Note: all users are allowed to perform to gesture. If devices is null, all devices of type deviceType are allowed to perform the gesture.

Throws:
IllegalArgumentException

addGestureClass

void addGestureClass(String gestureClass,
                     int user,
                     String deviceType,
                     Set<String> devices)
                     throws IllegalArgumentException
Add a gesture class to the composite gesture and specify the user and the device type used to perform it. Note: if devices is null, all devices of type deviceType are allowed to perform the gesture.

Throws:
IllegalArgumentException

removeGestureClass

void removeGestureClass(DefaultConstraintEntry entry)
Removes the specified gesture class from the composite.


removeAllGestureClasses

void removeAllGestureClasses()
Remove all gesture classes from the composite.


getGestureClasses

List<String> getGestureClasses()
Get all the names of the gesture classes that compose this composite gesture


getDistinctGestureClasses

Set<String> getDistinctGestureClasses()
Get the disctinct gesture classes that compose this composite gesture


getNumberOfGestures

int getNumberOfGestures()
Get the number of composing gestures


getGestureEntries

List<DefaultConstraintEntry> getGestureEntries()
Get all gesture entries.


validateConditions

boolean validateConditions(List<Gesture<?>> gestures,
                           IDeviceManager manager)
Validate the constraint conditions.

Parameters:
gestures - Gestures that possibly compose the composite gesture.
manager - Device manager to check the associated users.
Returns:

generatePatterns

Set<String> generatePatterns(Map<String,String> charMapping)
Generate all possible string patterns that represent the composite gesture.

Parameters:
charMapping - Mapping between the gesture class name and the character representation

determineTimeWindows

Map<String,Calendar> determineTimeWindows()
Determine the time window for each composing gesture.

Returns:
Mapping between the gesture name and the corresponding time window.

getParameters

Map<String,String> getParameters()
Returns an array of containing the constraint parameters.

Returns:
the constraint parameters.

getParameter

String getParameter(String property)

setParameter

void setParameter(String property,
                  String value)

toString

String toString()
Overrides:
toString in class Object

© 2006-2007 ETH Zurich

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