© 2006-2007 ETH Zurich

org.ximtec.igesture.io
Class DeviceUserAssociation

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

public class DeviceUserAssociation
extends DefaultDataObject

This class defines an association between a IUser and a AbstractGestureDevice. Both objects are saved in the association. It extends DefaultDataObject so the association can be serialized. It also implements the Device interface.

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

Field Summary
 
Fields inherited from class org.ximtec.igesture.core.DefaultDataObject
PROPERTY_ID
 
Fields inherited from class org.ximtec.igesture.core.DefaultPropertyChangeNotifier
propertyChangeSupport
 
Constructor Summary
DeviceUserAssociation(AbstractGestureDevice<?,?> device, IUser user)
          Constructor
 
Method Summary
 void connect()
           
 void disconnect()
           
 boolean getConnected()
          Check whether the device is connected or not.
 String getConnectionType()
           
 String getDeviceClass()
           
 String getDeviceID()
           
 AbstractGestureDevice<?,?> getDeviceItem()
          Get the device of this association.
 String getDeviceType()
           
 String getName()
           
 String getUser()
          Get a String representation of the user.
 IUser getUserItem()
          Get the associated User.
 boolean isConnectable()
           
 boolean isConnected()
           
 boolean isDefaultDevice()
           
 boolean isDisconnectable()
           
 void setConnected(boolean isConnected)
          Change the connection status of the device.
 void setConnectionType(String connectionType)
           
 void setDefaultDevice(boolean isDefault)
           
 void setDeviceID(String id)
           
 void setIsConnected(boolean isConnected)
           
 void setName(String name)
           
 void setUser(User user)
          Set the associated user.
 String toString()
           
 
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

DeviceUserAssociation

public DeviceUserAssociation(AbstractGestureDevice<?,?> device,
                             IUser user)
Constructor

Parameters:
device - The device.
user - The user to associate with the device.
Method Detail

connect

public void connect()

disconnect

public void disconnect()

getConnectionType

public String getConnectionType()

getDeviceID

public String getDeviceID()

getDeviceType

public String getDeviceType()

getName

public String getName()

isConnectable

public boolean isConnectable()

isDisconnectable

public boolean isDisconnectable()

setConnectionType

public void setConnectionType(String connectionType)

setDeviceID

public void setDeviceID(String id)

setName

public void setName(String name)

setUser

public void setUser(User user)
Set the associated user.

Parameters:
user - The user to associate.

getUser

public String getUser()
Get a String representation of the user.

Returns:
String representation of the user.

getDeviceItem

public AbstractGestureDevice<?,?> getDeviceItem()
Get the device of this association.

Returns:
The device.

getUserItem

public IUser getUserItem()
Get the associated User.

Returns:
The associated user.

isDefaultDevice

public boolean isDefaultDevice()

setDefaultDevice

public void setDefaultDevice(boolean isDefault)

isConnected

public boolean isConnected()

setIsConnected

public void setIsConnected(boolean isConnected)

getConnected

public boolean getConnected()
Check whether the device is connected or not.

Returns:
True if connected, else false.
See Also:
isConnected()

setConnected

public void setConnected(boolean isConnected)
Change the connection status of the device.

Parameters:
isConnected - The new connection status.
See Also:
setIsConnected(boolean)

toString

public String toString()
Overrides:
toString in class Object

getDeviceClass

public String getDeviceClass()

© 2006-2007 ETH Zurich

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