edu.stanford.hci.dtools
Class DeviceConfiguration

java.lang.Object
  extended by edu.stanford.hci.dtools.DeviceConfiguration
All Implemented Interfaces:
java.io.Serializable

public class DeviceConfiguration
extends java.lang.Object
implements java.io.Serializable

Class maintaining global configuration of the inputs and outputs available to the device. To add a new component or remove an old one, do it here.

This software is distributed under the BSD License.

Author:
Michael Bernstein ( mbernst(AT)stanford.edu ), Bjoern Hartmann ( bjoern(AT)stanford.edu )
See Also:
Serialized Form

Constructor Summary
DeviceConfiguration()
           
DeviceConfiguration(org.eclipse.draw2d.geometry.Dimension defaultSize)
           
 
Method Summary
 void addInputComponent(InputComponent input)
          Add a new InputComponent to the configuration
 void addOutputComponent(OutputComponent output)
           
 org.eclipse.draw2d.geometry.Dimension getDefaultDeviceDimensions()
           
 java.util.List<InputComponent> getInputArray()
          Get an ArrayList of all InputComponents in the device configuration.
 InputComponent getInputComponentForHardwareAddress(java.lang.String address)
           
 InputComponent getInputForName(java.lang.String name)
          Returns the InputComponent for the given component name
 InputComponent getInputForPrivateName(java.lang.String name)
          Returns the InputComponent for the given private component name
 int getInputIndexForComponent(InputComponent c)
          called by inputpair
 java.lang.String[] getInputNames()
           
 java.util.List<OutputComponent> getOutputArray()
          Get an array list of all output components in the configuration
 OutputComponent getOutputForName(java.lang.String name)
          Given a name, return the output component with that name.
 OutputComponent getOutputForPrivateName(java.lang.String name)
          Returns the OutputComponent for the given private component name
 java.lang.String[] getOutputNames()
           
 java.lang.String[] getPrivateInputNames()
           
 java.lang.String[] getPrivateOutputNames()
           
 java.lang.String getStateBackground()
          Get a string corresponding to the image which renders as the state background
 void setStateBackground(java.lang.String imagefile)
          Set the string corresponding to the image rendering as the state background
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeviceConfiguration

public DeviceConfiguration()

DeviceConfiguration

public DeviceConfiguration(org.eclipse.draw2d.geometry.Dimension defaultSize)
Method Detail

addInputComponent

public void addInputComponent(InputComponent input)
Add a new InputComponent to the configuration


getInputArray

public java.util.List<InputComponent> getInputArray()
Get an ArrayList of all InputComponents in the device configuration.


getInputNames

public java.lang.String[] getInputNames()

getInputComponentForHardwareAddress

public InputComponent getInputComponentForHardwareAddress(java.lang.String address)

getPrivateInputNames

public java.lang.String[] getPrivateInputNames()

getInputForName

public InputComponent getInputForName(java.lang.String name)
Returns the InputComponent for the given component name

Parameters:
name -
Returns:

getInputIndexForComponent

public int getInputIndexForComponent(InputComponent c)
called by inputpair


getInputForPrivateName

public InputComponent getInputForPrivateName(java.lang.String name)
Returns the InputComponent for the given private component name

Parameters:
name -
Returns:

addOutputComponent

public void addOutputComponent(OutputComponent output)

getOutputArray

public java.util.List<OutputComponent> getOutputArray()
Get an array list of all output components in the configuration

Returns:

getOutputNames

public java.lang.String[] getOutputNames()

getPrivateOutputNames

public java.lang.String[] getPrivateOutputNames()

getOutputForName

public OutputComponent getOutputForName(java.lang.String name)
Given a name, return the output component with that name. Assumes the output components are named uniquely.

Parameters:
name -
Returns:

getOutputForPrivateName

public OutputComponent getOutputForPrivateName(java.lang.String name)
Returns the OutputComponent for the given private component name

Parameters:
name -
Returns:

getDefaultDeviceDimensions

public org.eclipse.draw2d.geometry.Dimension getDefaultDeviceDimensions()

setStateBackground

public void setStateBackground(java.lang.String imagefile)
Set the string corresponding to the image rendering as the state background

Parameters:
imagefile -

getStateBackground

public java.lang.String getStateBackground()
Get a string corresponding to the image which renders as the state background

Returns: