© 2006-2007 ETH Zurich

org.ximtec.igesture.tool.view.devicemanager
Class DeviceManagerController

java.lang.Object
  extended by org.ximtec.igesture.tool.core.DefaultController
      extended by org.ximtec.igesture.tool.view.devicemanager.DeviceManagerController
All Implemented Interfaces:
PropertyChangeListener, EventListener, IDeviceManager, Controller
Direct Known Subclasses:
DeviceManagerService

public class DeviceManagerController
extends DefaultController
implements IDeviceManager

This class is an implementation of the controller of the Device Manager. It implements the IDeviceManager interface. It also extends DefaultController to allow easy instantion by the main controller of the workbench.

Author:
Bjorn Puype, bpuype@gmail.com

Constructor Summary
DeviceManagerController(Controller parentController, String key, org.sigtec.graphix.GuiBundle guiBundle)
          Constructor
 
Method Summary
 void addDevice(AbstractGestureDevice<?,?> device, IUser user)
          Add a device and associate it with a user.
 void addDeviceManagerListener(DeviceManagerListener listener)
           
 void addUser(IUser user)
          Add a user.
 boolean areInitialsValid(String initials)
           
 void associateUser(AbstractGestureDevice<?,?> device, IUser user)
          Associate a user with a device.
 IUser getAssociatedUser(GestureDevice<?,?> device)
          Get the user that is associated with device
 IUser getDefaultUser()
          Get the default user of the system (aka system user).
 Set<AbstractGestureDevice<?,?>> getDevices()
          Get all devices registered with the controller.
 Map<String,DeviceDiscoveryService> getDiscoveryMapping()
          Get the mapping between connection types and discovery services.
 boolean getEnableAddDevicesAction()
          This method returns true if the add devices action should be enabled
 Set<IUser> getUsers()
          Get all users registered with the controller.
 TabbedView getView()
          Returns the view component for this specific controller.
 void loadConfiguration(File file)
          Load a user and device configuration from file.
 void notifyDeviceManagerListener(int operation, AbstractGestureDevice<?,?> device)
           
 void removeAllDeviceManagerListener()
           
 void removeDevice(AbstractGestureDevice<?,?> device)
          Remove a device.
 void removeDeviceManagerListener(DeviceManagerListener listener)
           
 void removeUser(IUser user)
          Remove a user
 void saveConfiguration(File file)
          Save the current user and device configuration to file.
 void showView(Point p)
          Show the view at a certain point.
 
Methods inherited from class org.ximtec.igesture.tool.core.DefaultController
addAction, addController, execute, getAction, getControllers, getLocator, getParent, isRoot, propertyChange, removeAllControllers, removeController, setLocator, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceManagerController

public DeviceManagerController(Controller parentController,
                               String key,
                               org.sigtec.graphix.GuiBundle guiBundle)
Constructor

Parameters:
parentController -
key -
guiBundle -
Method Detail

getEnableAddDevicesAction

public boolean getEnableAddDevicesAction()
This method returns true if the add devices action should be enabled

Returns:

getView

public TabbedView getView()
Description copied from interface: Controller
Returns the view component for this specific controller.

Specified by:
getView in interface Controller
Returns:
the view component for this specific controller.

addDevice

public void addDevice(AbstractGestureDevice<?,?> device,
                      IUser user)
Description copied from interface: IDeviceManager
Add a device and associate it with a user.

Specified by:
addDevice in interface IDeviceManager
Parameters:
device - The device to add.
user - The user to associate with the device.

addUser

public void addUser(IUser user)
Description copied from interface: IDeviceManager
Add a user.

Specified by:
addUser in interface IDeviceManager

getDefaultUser

public IUser getDefaultUser()
Description copied from interface: IDeviceManager
Get the default user of the system (aka system user).

Specified by:
getDefaultUser in interface IDeviceManager
Returns:
default user.

getDevices

public Set<AbstractGestureDevice<?,?>> getDevices()
Description copied from interface: IDeviceManager
Get all devices registered with the controller.

Specified by:
getDevices in interface IDeviceManager
Returns:
A set of devices.

getUsers

public Set<IUser> getUsers()
Description copied from interface: IDeviceManager
Get all users registered with the controller.

Specified by:
getUsers in interface IDeviceManager
Returns:
A set of users.

removeDevice

public void removeDevice(AbstractGestureDevice<?,?> device)
Description copied from interface: IDeviceManager
Remove a device.

Specified by:
removeDevice in interface IDeviceManager
Parameters:
device - The device to remove.

removeUser

public void removeUser(IUser user)
Description copied from interface: IDeviceManager
Remove a user

Specified by:
removeUser in interface IDeviceManager

associateUser

public void associateUser(AbstractGestureDevice<?,?> device,
                          IUser user)
Description copied from interface: IDeviceManager
Associate a user with a device.

Specified by:
associateUser in interface IDeviceManager
Parameters:
device - The device.
user - The user to associate with the device.

showView

public void showView(Point p)
Description copied from interface: IDeviceManager
Show the view at a certain point.

Specified by:
showView in interface IDeviceManager
Parameters:
p - The desired point

saveConfiguration

public void saveConfiguration(File file)
Description copied from interface: IDeviceManager
Save the current user and device configuration to file.

Specified by:
saveConfiguration in interface IDeviceManager
Parameters:
file - The file to save to.

loadConfiguration

public void loadConfiguration(File file)
Description copied from interface: IDeviceManager
Load a user and device configuration from file.

Specified by:
loadConfiguration in interface IDeviceManager
Parameters:
file - The file to load from.

getDiscoveryMapping

public Map<String,DeviceDiscoveryService> getDiscoveryMapping()
Description copied from interface: IDeviceManager
Get the mapping between connection types and discovery services.

Specified by:
getDiscoveryMapping in interface IDeviceManager
Returns:

addDeviceManagerListener

public void addDeviceManagerListener(DeviceManagerListener listener)
Specified by:
addDeviceManagerListener in interface IDeviceManager

removeDeviceManagerListener

public void removeDeviceManagerListener(DeviceManagerListener listener)
Specified by:
removeDeviceManagerListener in interface IDeviceManager

removeAllDeviceManagerListener

public void removeAllDeviceManagerListener()
Specified by:
removeAllDeviceManagerListener in interface IDeviceManager

notifyDeviceManagerListener

public void notifyDeviceManagerListener(int operation,
                                        AbstractGestureDevice<?,?> device)
Specified by:
notifyDeviceManagerListener in interface IDeviceManager

getAssociatedUser

public IUser getAssociatedUser(GestureDevice<?,?> device)
Description copied from interface: IDeviceManager
Get the user that is associated with device

Specified by:
getAssociatedUser in interface IDeviceManager

areInitialsValid

public boolean areInitialsValid(String initials)

© 2006-2007 ETH Zurich

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