© 2006-2007 ETH Zurich

org.ximtec.igesture.core.composite
Class ProximityConcurrencyConstraint

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.ConcurrencyConstraint
                  extended by org.ximtec.igesture.core.composite.ProximityConcurrencyConstraint
All Implemented Interfaces:
Serializable, Constraint, DataObject, PropertyChangeNotifier

public class ProximityConcurrencyConstraint
extends ConcurrencyConstraint

This class represents a two-fold constraint. First the gestures have to be performed concurrently and secondly, they have to be performed in each others vicinity. The minimum and maximum distance has to be defined. This distance is the diagonal of the rectangular bounding box of the gestures for 2D gestures, for 3D gestures it is the diagonal of each facet of a cubic bounding space.

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

Nested Class Summary
static class ProximityConcurrencyConstraint.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
ProximityConcurrencyConstraint()
           
 
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.
 String getDistanceUnit()
          Get the distance unit.
 double getMaxDistance()
          Get the maximum distance between two gestures.
 double getMinDistance()
          Get the minimum distance between two gestures.
 void setDistanceUnit(String distanceUnit)
          Set the distance unit.
 void setMaxDistance(String maxDistance)
          Set the maximum distance between two gestures.
 void setMinDistance(String minDistance)
          Set the minimum distance 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.ConcurrencyConstraint
determineTimeWindows, generatePatterns
 
Methods inherited from class org.ximtec.igesture.core.composite.DefaultConstraint
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

ProximityConcurrencyConstraint

public ProximityConcurrencyConstraint()
Method Detail

addGestureClass

public void addGestureClass(String gestureClass)
Description copied from interface: Constraint
Add a gesture class to the composite gesture. Note: All users and devices are allowed to perform the gesture.

Specified by:
addGestureClass in interface Constraint
Overrides:
addGestureClass in class DefaultConstraint

addGestureClass

public void addGestureClass(String gestureClass,
                            int user)
Description copied from interface: Constraint
Add a gesture class to the composite gesture and specify the user that performs it. Note: All devices are allowed to perform the gesture.

Specified by:
addGestureClass in interface Constraint
Overrides:
addGestureClass in class DefaultConstraint

addGestureClass

public void addGestureClass(String gestureClass,
                            String deviceType,
                            Set<String> devices)
Description copied from interface: Constraint
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.

Specified by:
addGestureClass in interface Constraint
Overrides:
addGestureClass in class DefaultConstraint

addGestureClass

public void addGestureClass(String gestureClass,
                            int user,
                            String deviceType,
                            Set<String> devices)
Description copied from interface: Constraint
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.

Specified by:
addGestureClass in interface Constraint
Overrides:
addGestureClass in class DefaultConstraint

getMinDistance

public double getMinDistance()
Get the minimum distance between two gestures.


setMinDistance

public void setMinDistance(String minDistance)
                    throws NumberFormatException
Set the minimum distance between two gestures.

Throws:
NumberFormatException

getMaxDistance

public double getMaxDistance()
Get the maximum distance between two gestures.


setMaxDistance

public void setMaxDistance(String maxDistance)
                    throws NumberFormatException
Set the maximum distance between two gestures.

Throws:
NumberFormatException

getDistanceUnit

public String getDistanceUnit()
Get the distance unit.

See Also:
Constraint

setDistanceUnit

public void setDistanceUnit(String distanceUnit)
Set the distance unit.

See Also:
Constraint

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 ConcurrencyConstraint
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 ConcurrencyConstraint

© 2006-2007 ETH Zurich

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