edu.stanford.hci.dtools.statechart.model
Class IOModel

java.lang.Object
  extended by edu.stanford.hci.dtools.statechart.model.ModelElement
      extended by edu.stanford.hci.dtools.statechart.model.ShapeModel
          extended by edu.stanford.hci.dtools.statechart.model.IOModel
All Implemented Interfaces:
java.io.Serializable, org.eclipse.ui.views.properties.IPropertySource
Direct Known Subclasses:
InputModel, OutputModel

public abstract class IOModel
extends ShapeModel

This class is the superclass for any instance of a ButtonModel, LCDModel, etc. It provides simple information about the model's offset within the StateModel, the default draw image, and else. These are NOT editable, as the real "global model" of these models are in dtools.component!

This software is distributed under the BSD License.

Author:
Michael Bernstein ( mbernst(AT)stanford.edu ), Bjoern Hartmann ( bjoern(AT)stanford.edu ) TODO: clean up get/setPropertyDescriptors code duplicates
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.stanford.hci.dtools.statechart.model.ShapeModel
DIAGRAM_PROP, LOCATION_PROP, SIZE_PROP, SOURCE_CONNECTIONS_PROP, TARGET_CONNECTIONS_PROP
 
Constructor Summary
IOModel()
           
IOModel(IOComponent model)
          Constructor
IOModel(IOModel copy)
           
 
Method Summary
abstract  IOModel copy()
           
 org.eclipse.draw2d.geometry.Point getDimensions()
           
 org.eclipse.draw2d.geometry.Dimension getDimensions(org.eclipse.draw2d.geometry.Dimension parentDimensions)
          Get the dimensions of this iomodel in its state
 IOComponent getGlobalComponent()
           
 org.eclipse.swt.graphics.Image getIcon()
          Return a pictogram (small icon) describing this model element.
 org.eclipse.draw2d.geometry.Point getLocation()
          Return the Location of this shape.
 org.eclipse.draw2d.geometry.Point getLocation(org.eclipse.draw2d.geometry.Dimension parentDimensions)
          Get the location of this iomodel in the state
 java.lang.String getName()
           
 org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
          Returns an array of IPropertyDescriptors for this shape.
 java.lang.Object getPropertyValue(java.lang.Object propertyId)
          Return the property value for the given propertyId, or null.
 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.statechart.model.ShapeModel
createImage, getDiagramModel, getSize, getSourceConnections, getTargetConnections, setDiagramModel, setLocation, setSize
 
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

IOModel

public IOModel()

IOModel

public IOModel(IOComponent model)
Constructor

Parameters:
model - The component that this model is derived from

IOModel

public IOModel(IOModel copy)
Method Detail

copy

public abstract IOModel copy()

getLocation

public org.eclipse.draw2d.geometry.Point getLocation(org.eclipse.draw2d.geometry.Dimension parentDimensions)
Get the location of this iomodel in the state

Parameters:
parentDimensions - the dimensions of the state itself (used for scaling)
Returns:

getLocation

public org.eclipse.draw2d.geometry.Point getLocation()
Description copied from class: ShapeModel
Return the Location of this shape.

Overrides:
getLocation in class ShapeModel
Returns:
a non-null location instance

getDimensions

public org.eclipse.draw2d.geometry.Dimension getDimensions(org.eclipse.draw2d.geometry.Dimension parentDimensions)
Get the dimensions of this iomodel in its state

Parameters:
parentDimensions - the dimensions of the state itself (used for scaling)
Returns:

getDimensions

public org.eclipse.draw2d.geometry.Point getDimensions()

getName

public java.lang.String getName()

getGlobalComponent

public IOComponent getGlobalComponent()

getPropertyDescriptors

public org.eclipse.ui.views.properties.IPropertyDescriptor[] getPropertyDescriptors()
Returns an array of IPropertyDescriptors for this shape.

The returned array is used to fill the property view, when the edit-part corresponding to this model element is selected.

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

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 ShapeModel
See Also:
ShapeModel.descriptors, 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 ShapeModel
See Also:
ShapeModel.descriptors, getPropertyDescriptors()

getIcon

public org.eclipse.swt.graphics.Image getIcon()
Description copied from class: ShapeModel
Return a pictogram (small icon) describing this model element. Children should override this method and return an appropriate Image.

Specified by:
getIcon in class ShapeModel
Returns:
a 16x16 Image or null