edu.stanford.hci.dtools.deviceeditor.components
Class InputComponent

java.lang.Object
  extended by edu.stanford.hci.dtools.statechart.model.ModelElement
      extended by edu.stanford.hci.dtools.deviceeditor.components.IOComponent
          extended by edu.stanford.hci.dtools.deviceeditor.components.InputComponent
All Implemented Interfaces:
java.io.Serializable, org.eclipse.ui.views.properties.IPropertySource
Direct Known Subclasses:
AccelerometerComponent, ButtonComponent, ContinuousInputComponent, SwitchComponent, TimerComponent

public abstract class InputComponent
extends IOComponent

d.tools interface representing all devices which can provide input to the system. This includes buttons, sliders, etc.

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

Field Summary
 
Fields inherited from class edu.stanford.hci.dtools.deviceeditor.components.IOComponent
CONNECTION_PROP, CONTINUOUS_RANGE_MAX, CONTINUOUS_RANGE_MIN, HARDWARE_PROP, HIGHLIGHT_PROP, IMAGE_PROP, LOCATION_PROP, SIZE_PROP, SOCKET_PROP
 
Constructor Summary
InputComponent()
           
InputComponent(InputComponent copy)
           
InputComponent(java.lang.String name, java.lang.String image, org.eclipse.draw2d.geometry.Point location, org.eclipse.draw2d.geometry.Dimension dimensions, java.lang.String hardware)
           
 
Method Summary
abstract  java.util.ArrayList<EventConditional> generateEvents()
           
abstract  EventConditional getDefaultEvent(java.util.ArrayList<EventConditional> possibleInputs)
           
 java.lang.Object getPropertyValue(java.lang.Object propertyId)
          Return the property value for the given propertyId, or null.
abstract  boolean hasEvent(EventConditional e)
          returns true if this inputcomponent has a matching event
 void setPropertyValue(java.lang.Object propertyId, java.lang.Object value)
          Set the property value for the given property id.
abstract  void update(java.lang.Object[] arguments)
          Updates the component state based on incoming messages
 
Methods inherited from class edu.stanford.hci.dtools.deviceeditor.components.IOComponent
getControlSignalSources, getControlSignalTargets, getCopy, getDefaultContinuousControlSignalTarget, getDefaultControlSignalSource, getDefaultDiscreteControlSignalTarget, getDefaultImage, getDeviceConfiguration, getDiagramComponent, getHardwareAddress, getHardwareConnection, getHardwareConnectionImage, getHighlighted, getImageFilename, getLocation, getName, getPrivateName, getPropertyDescriptors, getSize, getSocket, getSocketImage, getTypeName, setDeviceConfiguration, setDiagramComponent, setHardwareAddress, setHardwareConnection, setHighlighted, setImageFilename, setLocation, setName, setPrivateName, setSize, setSocket
 
Methods inherited from class edu.stanford.hci.dtools.statechart.model.ModelElement
addPropertyChangeListener, getEditableValue, isPropertySet, removePropertyChangeListener, resetPropertyValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputComponent

public InputComponent(java.lang.String name,
                      java.lang.String image,
                      org.eclipse.draw2d.geometry.Point location,
                      org.eclipse.draw2d.geometry.Dimension dimensions,
                      java.lang.String hardware)

InputComponent

public InputComponent()

InputComponent

public InputComponent(InputComponent copy)
Method Detail

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object propertyId)
Return the property value for the given propertyId, or null.

The property view uses the IDs from the IPropertyDescriptors array to obtain the value of the corresponding properties.

Specified by:
getPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Overrides:
getPropertyValue in class IOComponent
See Also:
IOComponent.descriptors, IOComponent.getPropertyDescriptors()

setPropertyValue

public void setPropertyValue(java.lang.Object propertyId,
                             java.lang.Object value)
Set the property value for the given property id. If no matching id is found, the call is forwarded to the superclass.

The property view uses the IDs from the IPropertyDescriptors array to set the values of the corresponding properties.

Specified by:
setPropertyValue in interface org.eclipse.ui.views.properties.IPropertySource
Overrides:
setPropertyValue in class IOComponent
See Also:
IOComponent.descriptors, IOComponent.getPropertyDescriptors()

hasEvent

public abstract boolean hasEvent(EventConditional e)
returns true if this inputcomponent has a matching event


getDefaultEvent

public abstract EventConditional getDefaultEvent(java.util.ArrayList<EventConditional> possibleInputs)

generateEvents

public abstract java.util.ArrayList<EventConditional> generateEvents()

update

public abstract void update(java.lang.Object[] arguments)
Updates the component state based on incoming messages

Parameters:
arguments - arguments of the OSC message received