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

java.lang.Object
  extended by edu.stanford.hci.dtools.statechart.model.ModelElement
      extended by edu.stanford.hci.dtools.statechart.model.DiagramModel
All Implemented Interfaces:
java.io.Serializable, org.eclipse.ui.views.properties.IPropertySource

public class DiagramModel
extends ModelElement

This software is distributed under the BSD License.

Author:
Scott Klemmer ( srk(AT)cs.stanford.edu ), Bjoern Hartmann ( bjoern(AT)stanford.edu )
See Also:
Serialized Form

Field Summary
static java.lang.String CHILD_ADDED_PROP
          Property ID to use when a child is added to this diagram.
static java.lang.String CHILD_REMOVED_PROP
          Property ID to use when a child is removed from this diagram.
 
Constructor Summary
DiagramModel()
           
 
Method Summary
 boolean addChild(ShapeModel s)
          Add a shape to this diagram.
 java.util.List<ModelElement> getChildren()
          Return a List of Shapes in this diagram.
 DeviceConfiguration getDeviceConfiguration()
          Returns our device configuration
 RunModeTracker getRunModeTracker()
           
 StatechartEditor getStatechartEditor()
           
 boolean removeChild(ShapeModel s)
          Remove a shape from this diagram.
 void setDeviceConfiguration(DeviceConfiguration dc)
           
 void setShapesEditor(StatechartEditor editor)
           
 void setStartStateMarker(StateModel state)
          Tells the marker to start tracking a new state.
 void updateDeviceConfiguration(DeviceConfiguration newConfig, IOComponentHashMap deviceMapping, java.util.Map<StateModel,java.util.List<ComponentConnectionModel>> componentConnectionMap)
          Call when the device configuration has changed and the diagram should propogate this change amongst its children.
 void updateStartStateMarkerModel()
          Tells the marker to update its location (presumably because the underlying state has moved)
 
Methods inherited from class edu.stanford.hci.dtools.statechart.model.ModelElement
addPropertyChangeListener, getEditableValue, getPropertyDescriptors, getPropertyValue, isPropertySet, removePropertyChangeListener, resetPropertyValue, setPropertyValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHILD_ADDED_PROP

public static final java.lang.String CHILD_ADDED_PROP
Property ID to use when a child is added to this diagram.

See Also:
Constant Field Values

CHILD_REMOVED_PROP

public static final java.lang.String CHILD_REMOVED_PROP
Property ID to use when a child is removed from this diagram.

See Also:
Constant Field Values
Constructor Detail

DiagramModel

public DiagramModel()
Method Detail

addChild

public boolean addChild(ShapeModel s)
Add a shape to this diagram.

Parameters:
s - a non-null shape instance
Returns:
true, if the shape was added, false otherwise

setStartStateMarker

public void setStartStateMarker(StateModel state)
Tells the marker to start tracking a new state. Lazily creates the marker

Parameters:
state -

updateStartStateMarkerModel

public void updateStartStateMarkerModel()
Tells the marker to update its location (presumably because the underlying state has moved)


getChildren

public java.util.List<ModelElement> getChildren()
Return a List of Shapes in this diagram. The returned List should not be modified.


removeChild

public boolean removeChild(ShapeModel s)
Remove a shape from this diagram.

Parameters:
s - a non-null shape instance;
Returns:
true, if the shape was removed, false otherwise

updateDeviceConfiguration

public void updateDeviceConfiguration(DeviceConfiguration newConfig,
                                      IOComponentHashMap deviceMapping,
                                      java.util.Map<StateModel,java.util.List<ComponentConnectionModel>> componentConnectionMap)
Call when the device configuration has changed and the diagram should propogate this change amongst its children. Could also be implemented using a listener architecture. Called BEFORE the actual configuration is changed, so passes the newConfig around.

Parameters:
newConfig -

setShapesEditor

public void setShapesEditor(StatechartEditor editor)

getStatechartEditor

public StatechartEditor getStatechartEditor()

getDeviceConfiguration

public DeviceConfiguration getDeviceConfiguration()
Returns our device configuration


setDeviceConfiguration

public void setDeviceConfiguration(DeviceConfiguration dc)

getRunModeTracker

public RunModeTracker getRunModeTracker()