org.argouml.model
Interface StateMachinesHelper

All Known Implementing Classes:
AbstractStateMachinesHelperDecorator

public interface StateMachinesHelper

The interface for the helper for StateMachines.

Created from the old StateMachinesHelper.


Method Summary
 void addDeferrableEvent(Object state, Object deferrableEvent)
          Add a deferrable event to a state.
 void addSubvertex(Object handle, Object subvertex)
          Add a subvertex to a composite state.
 Object findNamespaceForEvent(Object trans, Object model)
          Find the correct namespace for an event.
 Object findOperationByName(Object trans, String opname)
          Finds the operation to which a CallEvent refers.
 Collection getAllPossibleStatemachines(Object model, Object oSubmachineState)
          Returns all statemachines that can be the statemachine the given submachinestate represents.
 Collection getAllPossibleSubvertices(Object oState)
          Returns all states that can be recursively contained by the given State.
 Collection getAllSubStates(Object compState)
          Returns all substates some composite state contains.
 Object getDestination(Object trans)
          Returns the destination of the given transition.
 Collection getOutgoingStates(Object ostatevertex)
          Gets all statevertices that are a target to transitions outgoing from the given statevertex.
 String getPath(Object o)
          Returns the path of a state vertex.
 Object getSource(Object trans)
          Returns the source of the given transition.
 Object getStatebyName(String path, Object container)
          Returns a state contained into container.
 Object getStateMachine(Object handle)
          Gets the statemachine that contains the given Object Traverses the state hierarchy of the statemachine untill the statemachine is reached.
 Object getTop(Object sm)
          Get the "top" composite state of a statemachine.
 boolean isAddingStatemachineAllowed(Object context)
          Returns true if a statemachine may be added to the given context.
 boolean isTopState(Object o)
          Returns true is the given state is the top state.
 void removeDeferrableEvent(Object state, Object deferrableEvent)
          Remove a deferrable event from a state.
 void removeSubvertex(Object handle, Object subvertex)
          Remove a given subvertex from a given composite state.
 void setBound(Object handle, int bound)
          Sets the Bound of some SynchState.
 void setChangeExpression(Object handle, Object value)
          Sets the change-expression for a ChangeEvent.
 void setConcurrent(Object handle, boolean concurrent)
          Makes a Composite State concurrent.
 void setContainer(Object handle, Object compositeState)
          Set the container of a statevertex.
 void setContext(Object statemachine, Object modelElement)
          Set the Context of a statemachine.
 void setDoActivity(Object handle, Object value)
          Sets the do activity of a state.
 void setEffect(Object handle, Object value)
          Sets the effect of some transition.
 void setEntry(Object handle, Object value)
          Sets the entry action of some state.
 void setEventAsTrigger(Object transition, Object event)
          Couples a given event to the given transition as being trigger event.
 void setExit(Object handle, Object value)
          Sets the exit action of some state.
 void setExpression(Object handle, Object value)
          Set the Expression of a Guard or ChangeEvent.
 void setGuard(Object handle, Object guard)
          Sets the guard of a transition.
 void setInternalTransitions(Object handle, Collection intTrans)
           
 void setReferenceState(Object o, String referenced)
          Sets the Referenced State of a StubState.
 void setSource(Object handle, Object state)
          Sets the source state of some message.
 void setState(Object handle, Object element)
          Sets the state of an internal transition.
 void setStateMachine(Object handle, Object stm)
          Sets a state machine of some state or transition.
 void setStatemachineAsSubmachine(Object oSubmachineState, Object oStatemachine)
          Connects a given statemachine to a submachinestate as being the statemachine the submachinestate represents.
 void setSubvertices(Object handle, Collection subvertices)
          Set the collection of substates for a CompositeState.
 void setTrigger(Object handle, Object event)
          Sets the trigger event of a transition.
 void setWhen(Object handle, Object value)
          Sets the time-expression for a TimeEvent.
 

Method Detail

getSource

public Object getSource(Object trans)
Returns the source of the given transition. This operation is here to give a full implementation of all getSource and getDestination methods on the uml helpers.

Parameters:
trans - the given transition
Returns:
MStateVertex the source statevertex

getDestination

public Object getDestination(Object trans)
Returns the destination of the given transition. This operation is here to give a full implementation of all getSource and getDestination methods on the uml helpers.

Parameters:
trans - the given transition
Returns:
MStateVertex the destination statevertex

getStateMachine

public Object getStateMachine(Object handle)
Gets the statemachine that contains the given Object Traverses the state hierarchy of the statemachine untill the statemachine is reached. To decouple ArgoUML as much as possible from the model implementation, the parameter of the method is of type Object, and the result, too.

Only if the given handle is null, then an exception is thrown.

Parameters:
handle - The element for which we want to know the statemachine
Returns:
Object MStateMachine The statemachine the state belongs too or null if the given handle is not contained in this statemachine

setEventAsTrigger

public void setEventAsTrigger(Object transition,
                              Object event)
Couples a given event to the given transition as being trigger event. To decouple ArgoUML as much as possible from the model implementation, the parameters of the method are of type Object.

Parameters:
transition - the given transition
event - the given event

isAddingStatemachineAllowed

public boolean isAddingStatemachineAllowed(Object context)
Returns true if a statemachine may be added to the given context. To decouple ArgoUML as much as possible from the model implementation, the parameter of the method is of type Object.

Parameters:
context - the given context
Returns:
boolean true if a statemachine may be added

isTopState

public boolean isTopState(Object o)
Returns true is the given state is the top state.

Parameters:
o - CompositeState
Returns:
boolean

getAllPossibleStatemachines

public Collection getAllPossibleStatemachines(Object model,
                                              Object oSubmachineState)
Returns all statemachines that can be the statemachine the given submachinestate represents. To decouple ArgoUML as much as possible from the model implementation, the parameter of the method is of type Object.

Parameters:
model - the model
oSubmachineState - The submachinestate we are searching the statemachines for.
Returns:
Collection The collection with found statemachines.

getAllPossibleSubvertices

public Collection getAllPossibleSubvertices(Object oState)
Returns all states that can be recursively contained by the given State.

Parameters:
oState - the Composite state we are searching the states for,
Returns:
Collection the collection with found states

setStatemachineAsSubmachine

public void setStatemachineAsSubmachine(Object oSubmachineState,
                                        Object oStatemachine)
Connects a given statemachine to a submachinestate as being the statemachine the submachinestate represents. To decouple ArgoUML as much as possible from the model implementation, the parameters of the method are of type Object.

Parameters:
oSubmachineState - The submachinestate for which we want to set the property submachine
oStatemachine - The statemachine

getTop

public Object getTop(Object sm)
Get the "top" composite state of a statemachine.

Parameters:
sm - the given statemachine
Returns:
the top composite state

getOutgoingStates

public Collection getOutgoingStates(Object ostatevertex)
Gets all statevertices that are a target to transitions outgoing from the given statevertex.

Parameters:
ostatevertex - the given statevertex
Returns:
Collection all statevertices that are a target

findOperationByName

public Object findOperationByName(Object trans,
                                  String opname)
Finds the operation to which a CallEvent refers. TODO: This function works for the most normal cases, but needs some testing for rare cases, e.g. internal transitions,...

Parameters:
trans - Object of type MTransition
opname - the name of the operation sought
Returns:
Object The operation with the given name, or null.

getAllSubStates

public Collection getAllSubStates(Object compState)
Returns all substates some composite state contains.

Parameters:
compState - the given compositestate
Returns:
all substates

removeSubvertex

public void removeSubvertex(Object handle,
                            Object subvertex)
Remove a given subvertex from a given composite state.

Parameters:
handle - the composite state
subvertex - the StateVertex

addSubvertex

public void addSubvertex(Object handle,
                         Object subvertex)
Add a subvertex to a composite state.

Parameters:
handle - the CompositeState
subvertex - the StateVertex

setBound

public void setBound(Object handle,
                     int bound)
Sets the Bound of some SynchState.

Parameters:
handle - Synch State
bound - A positive integer or the value "unlimited" specifying the maximal count of the SynchState. The count is the difference between the number of times the incoming and outgoing transitions of the synch state are fired.

setConcurrent

public void setConcurrent(Object handle,
                          boolean concurrent)
Makes a Composite State concurrent.

Parameters:
handle - the CompositState
concurrent - boolean

setContainer

public void setContainer(Object handle,
                         Object compositeState)
Set the container of a statevertex.

Parameters:
handle - is the stateVertex
compositeState - is the container. Can be null.

setDoActivity

public void setDoActivity(Object handle,
                          Object value)
Sets the do activity of a state.

Parameters:
handle - is the state
value - the activity. Can be null.

setEffect

public void setEffect(Object handle,
                      Object value)
Sets the effect of some transition.

Parameters:
handle - is the transition
value - is the effect. Can be null.

setEntry

public void setEntry(Object handle,
                     Object value)
Sets the entry action of some state.

Parameters:
handle - is the state
value - is the action. Can be null.

setExit

public void setExit(Object handle,
                    Object value)
Sets the exit action of some state.

Parameters:
handle - is the state
value - is the action. Can be null.

setExpression

public void setExpression(Object handle,
                          Object value)
Set the Expression of a Guard or ChangeEvent.

Parameters:
handle - Guard or ChangeEvent
value - BooleanExpression or null

setGuard

public void setGuard(Object handle,
                     Object guard)
Sets the guard of a transition.

Parameters:
handle - to the transition
guard - to be set. Can be null.

setInternalTransitions

public void setInternalTransitions(Object handle,
                                   Collection intTrans)
Parameters:
handle - is the target.
intTrans - is a collection of transitions.

setSource

public void setSource(Object handle,
                      Object state)
Sets the source state of some message.

Parameters:
handle - the message
state - the source state

setState

public void setState(Object handle,
                     Object element)
Sets the state of an internal transition.

Parameters:
handle - the internal transition
element - the state that contains this transition

setStateMachine

public void setStateMachine(Object handle,
                            Object stm)
Sets a state machine of some state or transition.

Parameters:
handle - is the state or transition
stm - is the state machine

setSubvertices

public void setSubvertices(Object handle,
                           Collection subvertices)
Set the collection of substates for a CompositeState.

Parameters:
handle - CompositeState
subvertices - collection of sub-StateVertexes

setTrigger

public void setTrigger(Object handle,
                       Object event)
Sets the trigger event of a transition.

Parameters:
handle - is the transition
event - is the trigger event or null

setWhen

public void setWhen(Object handle,
                    Object value)
Sets the time-expression for a TimeEvent.

Parameters:
handle - Object (TimeEvent)
value - Object (TimeExpression)

setChangeExpression

public void setChangeExpression(Object handle,
                                Object value)
Sets the change-expression for a ChangeEvent.

Parameters:
handle - Object (ChangeEvent)
value - Object (BooleanExpression)

getPath

public String getPath(Object o)
Returns the path of a state vertex.

Parameters:
o - the StateVertex
Returns:
String

getStatebyName

public Object getStatebyName(String path,
                             Object container)
Returns a state contained into container.

Parameters:
path - The whole pathname of the state we are looking for.
container - of the state
Returns:
Object

setReferenceState

public void setReferenceState(Object o,
                              String referenced)
Sets the Referenced State of a StubState.

Parameters:
o - Stub State
referenced - state

findNamespaceForEvent

public Object findNamespaceForEvent(Object trans,
                                    Object model)
Find the correct namespace for an event. This explained by the following quote from the UML spec: "The event declaration has scope within the package it appears in and may be used in state diagrams for classes that have visibility inside the package. An event is not local to a single class."

Parameters:
trans - the transition of which the event is a trigger
model - the default is the model
Returns:
the enclosing namespace for the event

setContext

public void setContext(Object statemachine,
                       Object modelElement)
Set the Context of a statemachine.

Parameters:
statemachine - The state machine.
modelElement - The context.

addDeferrableEvent

public void addDeferrableEvent(Object state,
                               Object deferrableEvent)
Add a deferrable event to a state.

Parameters:
state - The state.
deferrableEvent - The deferrable event.

removeDeferrableEvent

public void removeDeferrableEvent(Object state,
                                  Object deferrableEvent)
Remove a deferrable event from a state.

Parameters:
state - The state.
deferrableEvent - The referrable event.


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Cookbook