© 2006-2007 ETH Zurich

org.ximtec.igesture.geco.gui
Class MainModel

java.lang.Object
  extended by org.ximtec.igesture.geco.gui.MainModel
All Implemented Interfaces:
GestureEventListener

public class MainModel
extends Object
implements GestureEventListener

Model for MainView class

Version:
0.9, Nov 20, 2007
Author:
Michele Croci, mcroci@gmail.com

Field Summary
static String GESTURE_SET
           
 Hashtable<String,GestureClass> gestureClassesTable
           
 
Constructor Summary
MainModel(Configuration conf, Configuration gestConf)
          Constructs a new main model.
 
Method Summary
 void addMapping(GestureToActionMapping gm)
          Adds a gesture-action mapping
 void clearData()
          Clear the list models and the mapping tables
 void configureInputDevice()
           
 Configuration getConfiguration()
          Returns the Configuration
 GestureActionManager getEventManager()
          Returns the event manager
 Configuration getGestureConfiguration()
          Get GestureConfiguration
 SortedListModel<GestureClass> getGestureListModel()
          Returns the model for the gesture List
 GestureSet getGestureSet()
          Returns the gesture set
 String getGestureSetFileName()
          Returns the project file
 SortedListModel<GestureToActionMapping> getMappingListModel()
          Returns the model for the mapping List
 Hashtable<GestureClass,GestureToActionMapping> getMappings()
           
 File getProjectFile()
          Returns the project file
 String getProjectName()
          Adds the gesture set to the gesture main model
 void handleChunks(List<?> chunks)
           
 void handleGesture(Gesture<?> gesture)
           
 void initRecogniser(GestureSet gestureSet)
           
 void loadData(StorageEngine engine)
          Loads the data.
 void loadGestureSet(GestureSet gestureSet)
          Adds the gesture set to the gesture main model
 boolean minimizeAsStartup()
          Application should be minimized
 boolean needSave()
          Should project be saved?
 void removeMapping(GestureToActionMapping gm)
          Removes a gesture-action mapping
 void resetInputDevice()
          Configure Input Client
 void setConfiguration(Configuration c)
          Set the configuration
 void setGestureConfiguration(Configuration conf)
          Set GestureConfiguration
 void setGestureSetFileName(String name)
          Set the project name
 void setNeedSave(boolean b)
          Set toBeSaved flag
 void setProjectFile(File f)
          Set the project file
 void setProjectName(String name)
          Set the project name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gestureClassesTable

public Hashtable<String,GestureClass> gestureClassesTable

GESTURE_SET

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

MainModel

public MainModel(Configuration conf,
                 Configuration gestConf)
Constructs a new main model.

Parameters:
engine - the storage engine used by the storage manager.
Method Detail

loadData

public void loadData(StorageEngine engine)
Loads the data.

Parameters:
engine - the storage engine used by the storage manager.

loadGestureSet

public void loadGestureSet(GestureSet gestureSet)
Adds the gesture set to the gesture main model

Parameters:
gestureSet - the gesture set to be added.

clearData

public void clearData()
Clear the list models and the mapping tables


setProjectFile

public void setProjectFile(File f)
Set the project file

Parameters:
f - the xml file in which the project is saved

setProjectName

public void setProjectName(String name)
Set the project name

Parameters:
name - the name of the project

getProjectFile

public File getProjectFile()
Returns the project file

Returns:
the xml file in which the project is saved

setGestureSetFileName

public void setGestureSetFileName(String name)
Set the project name

Parameters:
name - the name of the project

getGestureSetFileName

public String getGestureSetFileName()
Returns the project file

Returns:
the xml file in which the project is saved

getProjectName

public String getProjectName()
Adds the gesture set to the gesture main model

Parameters:
gestureSet - the gesture set to be added.

getGestureSet

public GestureSet getGestureSet()
Returns the gesture set

Returns:
the current GestureSet

getMappings

public Hashtable<GestureClass,GestureToActionMapping> getMappings()

addMapping

public void addMapping(GestureToActionMapping gm)
Adds a gesture-action mapping

Parameters:
gm - the mapping to be added

removeMapping

public void removeMapping(GestureToActionMapping gm)
Removes a gesture-action mapping

Parameters:
the - mapping to be removed

getGestureListModel

public SortedListModel<GestureClass> getGestureListModel()
Returns the model for the gesture List

Returns:
the model

getMappingListModel

public SortedListModel<GestureToActionMapping> getMappingListModel()
Returns the model for the mapping List

Returns:
the model

getEventManager

public GestureActionManager getEventManager()
Returns the event manager

Returns:
the event manager

getConfiguration

public Configuration getConfiguration()
Returns the Configuration

Returns:
the configuration

setConfiguration

public void setConfiguration(Configuration c)
Set the configuration

Parameters:
c - the Configuration to be set

setNeedSave

public void setNeedSave(boolean b)
Set toBeSaved flag

Parameters:
the - new value of the flag

needSave

public boolean needSave()
Should project be saved?

Returns:

initRecogniser

public void initRecogniser(GestureSet gestureSet)

resetInputDevice

public void resetInputDevice()
Configure Input Client


configureInputDevice

public void configureInputDevice()

getGestureConfiguration

public Configuration getGestureConfiguration()
Get GestureConfiguration


setGestureConfiguration

public void setGestureConfiguration(Configuration conf)
Set GestureConfiguration


minimizeAsStartup

public boolean minimizeAsStartup()
Application should be minimized


handleChunks

public void handleChunks(List<?> chunks)
Specified by:
handleChunks in interface GestureEventListener

handleGesture

public void handleGesture(Gesture<?> gesture)
Specified by:
handleGesture in interface GestureEventListener

© 2006-2007 ETH Zurich

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