© 2006-2007 ETH Zurich

org.ximtec.igesture.configuration
Class Configuration

java.lang.Object
  extended by org.ximtec.igesture.core.DefaultPropertyChangeNotifier
      extended by org.ximtec.igesture.core.DefaultDataObject
          extended by org.ximtec.igesture.configuration.Configuration
All Implemented Interfaces:
Serializable, Cloneable, DataObject, PropertyChangeNotifier

public class Configuration
extends DefaultDataObject
implements Cloneable

Configuration object used by the algorithms. The configuration object contains information about the used gesture set (1..*), the algorithm(s) to be used (1..*), the parameters for the algorithms, the minimal accuracy as well as the size of the result list in the result set.

Version:
1.0 Dec 2006
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch
See Also:
Serialized Form

Field Summary
static String PROPERTY_NAME
           
 
Fields inherited from class org.ximtec.igesture.core.DefaultDataObject
PROPERTY_ID
 
Fields inherited from class org.ximtec.igesture.core.DefaultPropertyChangeNotifier
propertyChangeSupport
 
Constructor Summary
Configuration()
          Constructs a new configuration and initialises the used containers.
Configuration(String name)
           
 
Method Summary
 void accept(Visitor visitor)
          Accepts a visitor.
 void addAlgorithm(String algorithm)
          Adds an algorithm to the configuration.
 void addGestureSet(GestureSet gestureSet)
          Adds a gesture set to the configuration.
 void addGestureSets(List<GestureSet> gestureSets)
          Adds a list of gesture sets to the configuration.
 void addParameter(String algorithm, String key, String value)
          Adds a key/value parameter to the specified algorithm.
 Object clone()
          Clones the Configuration instance.
 List<String> getAlgorithms()
          Returns the list with all algorithms.
 GestureHandler getGestureHandler()
          Returns the gesture handler.
 GestureSet getGestureSet()
          Returns the combined gesture set.
 List<GestureSet> getGestureSets()
          Returns the list of gesture sets.
 int getMaxResultSetSize()
          Returns the maximal result set size.
 double getMinAccuracy()
          Returns the minimal accuracy.
 String getName()
           
 Map<String,String> getParameters(String classname)
          Returns the map of parameters for a specific algorithm.
 void removeAlgorithm(String algorithm)
          Removes an algorithm from the configuration.
 void removeAllGestureSets()
          Removes all gesture sets.
 void removeGestureSet(GestureSet gestureSet)
          Removes a gesture set from the configuration.
 void removeParameters(String classname)
          Removes all parameter for a specific algorithm.
 void setGestureHandler(GestureHandler gestureHandler)
          Sets the gesture handler.
 void setMaxResultSetSize(int maxResultSetSize)
          Sets the maximal result set size.
 void setMinAccuracy(double minAccuracy)
          Sets the minimal accuracy.
 void setName(String name)
           
 String toString()
           
 
Methods inherited from class org.ximtec.igesture.core.DefaultDataObject
getId, setId
 
Methods inherited from class org.ximtec.igesture.core.DefaultPropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ximtec.igesture.core.PropertyChangeNotifier
addPropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, removePropertyChangeListener
 

Field Detail

PROPERTY_NAME

public static final String PROPERTY_NAME
See Also:
Constant Field Values
Constructor Detail

Configuration

public Configuration()
Constructs a new configuration and initialises the used containers.


Configuration

public Configuration(String name)
Method Detail

addGestureSet

public void addGestureSet(GestureSet gestureSet)
Adds a gesture set to the configuration.

Parameters:
gestureSet - the gesture set to be added.

addGestureSets

public void addGestureSets(List<GestureSet> gestureSets)
Adds a list of gesture sets to the configuration.

Parameters:
gestureSets - the list of gesture sets to be added.

removeAllGestureSets

public void removeAllGestureSets()
Removes all gesture sets.


removeGestureSet

public void removeGestureSet(GestureSet gestureSet)
Removes a gesture set from the configuration.

Parameters:
gestureSet - the gesture set to be removed.

getGestureSets

public List<GestureSet> getGestureSets()
Returns the list of gesture sets.

Returns:
List the list of gesture sets.

getGestureSet

public GestureSet getGestureSet()
Returns the combined gesture set.

Returns:
the combined gesture set.

addAlgorithm

public void addAlgorithm(String algorithm)
Adds an algorithm to the configuration.

Parameters:
algorithm - the algorithm to be added to the configuration.

removeAlgorithm

public void removeAlgorithm(String algorithm)
Removes an algorithm from the configuration.

Parameters:
algorithm - the algorithm to be removed.

getAlgorithms

public List<String> getAlgorithms()
Returns the list with all algorithms.

Returns:
the list with all algorithms.

addParameter

public void addParameter(String algorithm,
                         String key,
                         String value)
Adds a key/value parameter to the specified algorithm. If the parameter map does not exist it will be created.

Parameters:
algorithm - the algorithm the parameter has to be added to.
key - the key of the parameter to be added.
value - the parameter value the value of the parameter to be added.

getParameters

public Map<String,String> getParameters(String classname)
Returns the map of parameters for a specific algorithm.

Parameters:
classname - the classname of the algorithm whose parameters have to be returned.
Returns:
a hashmap with the algorithms parameters.

removeParameters

public void removeParameters(String classname)
Removes all parameter for a specific algorithm.

Parameters:
classname - the classname of the algorithm whose parameters have to be removed.

setGestureHandler

public void setGestureHandler(GestureHandler gestureHandler)
Sets the gesture handler.

Parameters:
gestureHandler - the gesture handler to be set.

getGestureHandler

public GestureHandler getGestureHandler()
Returns the gesture handler.

Returns:
the gesture handler.

setMinAccuracy

public void setMinAccuracy(double minAccuracy)
Sets the minimal accuracy.

Parameters:
minAccuracy - the minimal accuracy to be set.

getMinAccuracy

public double getMinAccuracy()
Returns the minimal accuracy.

Returns:
minimal accuracy.

setName

public void setName(String name)

getName

public String getName()

setMaxResultSetSize

public void setMaxResultSetSize(int maxResultSetSize)
Sets the maximal result set size.

Parameters:
maxResultSetSize - the maximal result set size.

getMaxResultSetSize

public int getMaxResultSetSize()
Returns the maximal result set size.

Returns:
the maximal result set size.

clone

public Object clone()
Clones the Configuration instance. The GestureSet and the EventManager are not cloned.

Overrides:
clone in class Object

accept

public void accept(Visitor visitor)
Description copied from class: DefaultDataObject
Accepts a visitor.

Specified by:
accept in interface DataObject
Overrides:
accept in class DefaultDataObject
Parameters:
visitor - the visitor to be used.

toString

public String toString()
Overrides:
toString in class Object

© 2006-2007 ETH Zurich

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