© 2006-2007 ETH Zurich

org.ximtec.igesture.tool.view
Class MainModel

java.lang.Object
  extended by org.ximtec.igesture.tool.view.MainModel
All Implemented Interfaces:
RunnableService, Service

public class MainModel
extends Object
implements RunnableService

The main model.

Version:
1.0, Mar 2008
Author:
Ueli Kurmann, igesture@uelikurmann.ch, Beat Signer, signer@inf.ethz.ch

Field Summary
static String IDENTIFIER
           
 
Constructor Summary
MainModel(StorageEngine engine, MainController mainController, Properties properties)
          Constructs a new main model.
 
Method Summary
 AlgorithmList getAlgorithmList()
          Returns an algorithm list (all algorithms are wrapped in an AlgorithmList) Attention: Implementation depends on the assumption that the list of algorithm will not change during runtime.
 List<Class<? extends Algorithm>> getAlgorithms()
          Returns a list of all available algorithms.
 List<Configuration> getConfigurations()
          Returns a list of configurations.
 GestureSetList getGestureSetList()
          Returns a gesture set list (all gesture sets are wrapped in a GestureSetList)
 List<GestureSet> getGestureSets()
          Returns a list with all gesture sets.
 String getIdentifier()
          Returns the identifier of the service.
 String getProjectName()
           
 Properties getProperties()
           
 String getProperty(String key)
          Returns the property value of the given key.
 IStorageManager getStorageManager()
          Returns the Storage Manager TODO: Investigate design!
 TestSetList getTestSetList()
           
 List<TestSet> getTestSets()
          Returns a list with all test sets.
 boolean isActive()
           
 void removeProperty(String key)
          Removes a property.
 void reset()
          Resets the service.
 void setProjectName(String projectName)
           
 void setProperty(String key, String value)
          Add / Set a property.
 void setStorageEngine(StorageEngine storageEngine)
          Sets the storage manager.
 void start()
          Starts the service.
 void stop()
          Stops the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDENTIFIER

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

MainModel

public MainModel(StorageEngine engine,
                 MainController mainController,
                 Properties properties)
Constructs a new main model.

Parameters:
engine - the storage engine to be used.
mainController - the main controller of the application.
proeprties - the properties
Method Detail

getGestureSets

public List<GestureSet> getGestureSets()
Returns a list with all gesture sets.

Returns:
a list with all gesture sets.

getTestSets

public List<TestSet> getTestSets()
Returns a list with all test sets.

Returns:
a list with all test sets.

getAlgorithms

public List<Class<? extends Algorithm>> getAlgorithms()
Returns a list of all available algorithms. TODO: The list of algorithm should be configurable in a property file.

Returns:
a list of all available algorithms.

getConfigurations

public List<Configuration> getConfigurations()
Returns a list of configurations.

Returns:
a list of configurations.

getGestureSetList

public GestureSetList getGestureSetList()
Returns a gesture set list (all gesture sets are wrapped in a GestureSetList)

Returns:
a gesture set list.

getTestSetList

public TestSetList getTestSetList()

getAlgorithmList

public AlgorithmList getAlgorithmList()
Returns an algorithm list (all algorithms are wrapped in an AlgorithmList) Attention: Implementation depends on the assumption that the list of algorithm will not change during runtime. TODO: Merge new/removed algorithms in the list during runtime.

Returns:
an algorithm list (all algorithms are wrapped in an AlgorithmList)

getIdentifier

public String getIdentifier()
Description copied from interface: Service
Returns the identifier of the service.

Specified by:
getIdentifier in interface Service
Returns:
the service's identifier.

reset

public void reset()
Description copied from interface: RunnableService
Resets the service.

Specified by:
reset in interface RunnableService

start

public void start()
Description copied from interface: RunnableService
Starts the service.

Specified by:
start in interface RunnableService

stop

public void stop()
Description copied from interface: RunnableService
Stops the service.

Specified by:
stop in interface RunnableService

getStorageManager

public IStorageManager getStorageManager()
Returns the Storage Manager TODO: Investigate design! Should be encapsulated. (UK)

Returns:

setStorageEngine

public void setStorageEngine(StorageEngine storageEngine)
Sets the storage manager. This method is used to change the main model's data source (the storage manager is wrapped in a dynamic proxy to register a PropertyChangeListener).

Parameters:
storageEngine -

setProperty

public void setProperty(String key,
                        String value)
Add / Set a property. Properties are key/value pairs and made persistent after shutting down the application.

Parameters:
key -
value -

getProperty

public String getProperty(String key)
Returns the property value of the given key.

Parameters:
key - the key of the property.
Returns:
the value of the property.

removeProperty

public void removeProperty(String key)
Removes a property.

Parameters:
key -

getProperties

public Properties getProperties()

isActive

public boolean isActive()

setProjectName

public void setProjectName(String projectName)

getProjectName

public String getProjectName()

© 2006-2007 ETH Zurich

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