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

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.OutputComponent
              extended by edu.stanford.hci.dtools.deviceeditor.components.LEDComponent
All Implemented Interfaces:
java.io.Serializable, org.eclipse.ui.views.properties.IPropertySource

public class LEDComponent
extends OutputComponent

Generic component for LEDs

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
static java.lang.String COLOR_PROP
          ID for the Color property value (used for by the corresponding property descriptor).
 
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
LEDComponent()
           
LEDComponent(LEDComponent copy)
           
LEDComponent(java.lang.String name, java.lang.String image, org.eclipse.draw2d.geometry.Point location, org.eclipse.draw2d.geometry.Dimension dimensions, java.lang.String hardware)
          Creates a generic LED component
 
Method Summary
 org.eclipse.swt.graphics.Color getColor()
          Gets the LED color when the LED is ON
 IOComponent getCopy()
           
 java.lang.String getDefaultImage()
          Return a string representing the image that should be returned if there is no other image to use
 java.lang.Object getPropertyValue(java.lang.Object propertyId)
          Return the property value for the given propertyId, or null.
 boolean isLEDOn()
           
 void setColor(org.eclipse.swt.graphics.RGB newColor)
          Sets the LED color when the LED is ON
 void setLEDOn(boolean ledOn)
           
 void setPropertyValue(java.lang.Object propertyId, java.lang.Object value)
          Set the property value for the given property id.
 
Methods inherited from class edu.stanford.hci.dtools.deviceeditor.components.IOComponent
getControlSignalSources, getControlSignalTargets, getDefaultContinuousControlSignalTarget, getDefaultControlSignalSource, getDefaultDiscreteControlSignalTarget, 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
 

Field Detail

COLOR_PROP

public static final java.lang.String COLOR_PROP
ID for the Color property value (used for by the corresponding property descriptor).

See Also:
Constant Field Values
Constructor Detail

LEDComponent

public LEDComponent(java.lang.String name,
                    java.lang.String image,
                    org.eclipse.draw2d.geometry.Point location,
                    org.eclipse.draw2d.geometry.Dimension dimensions,
                    java.lang.String hardware)
Creates a generic LED component

Parameters:
name -
image - an image you would like to draw in the background of the LED
location -
dimensions -

LEDComponent

public LEDComponent()

LEDComponent

public LEDComponent(LEDComponent copy)
Method Detail

getCopy

public IOComponent getCopy()
Specified by:
getCopy in class IOComponent

getColor

public org.eclipse.swt.graphics.Color getColor()
Gets the LED color when the LED is ON


setColor

public void setColor(org.eclipse.swt.graphics.RGB newColor)
Sets the LED color when the LED is ON

Parameters:
newLoc -

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()

getDefaultImage

public java.lang.String getDefaultImage()
Description copied from class: IOComponent
Return a string representing the image that should be returned if there is no other image to use

Specified by:
getDefaultImage in class IOComponent
Returns:

isLEDOn

public boolean isLEDOn()

setLEDOn

public void setLEDOn(boolean ledOn)