org.argouml.model.uml
Class StateMachinesFactoryImpl

java.lang.Object
  extended byorg.argouml.model.uml.AbstractUmlModelFactory
      extended byorg.argouml.model.uml.StateMachinesFactoryImpl
All Implemented Interfaces:
org.argouml.model.StateMachinesFactory

public class StateMachinesFactoryImpl
extends AbstractUmlModelFactory
implements org.argouml.model.StateMachinesFactory

Factory to create UML classes for the UML BehaviorialElements::StateMachines package.

MEvent and MStateVertex do not have create methods since they are abstract classes in the NSUML model.

TODO: Change visibility to package after reflection problem solved.

Since:
ARGO0.11.2

Field Summary
private  NSUMLModelImplementation nsmodel
          The model implementation.
 
Constructor Summary
(package private) StateMachinesFactoryImpl(NSUMLModelImplementation implementation)
          Don't allow instantiation.
 
Method Summary
 Object buildCallEvent(Object model)
          Builds a callevent whose namespace (and therefore the ownership) is the rootmodel.
 Object buildCallEvent(Object trans, String name, Object model)
          Create a initialized instance of a CallEvent with a name as a trigger for a Transition.
 Object buildChangeEvent(Object model)
          Builds a changeevent whose namespace (and therefore the ownership) is the rootmodel.
 Object buildChangeEvent(String s, Object model)
          Builds a changeevent whose namespace (and therefore the ownership) is the rootmodel.
 Object buildCompositeState(Object compositeState)
          Builds a compositestate initalized as a non-concurrent composite state.
 Object buildCompositeStateOnStateMachine(Object statemachine)
          Builds a compositestate as top for some statemachine.
 Object buildFinalState(Object compositeState)
          Builds a finalstate.
 Object buildGuard(Object transition)
          Builds a guard condition with a given transition.
 Object buildInternalTransition(Object state)
          Builds an internal transition for a given state.
 Object buildPseudoState(Object compositeState)
          Builds a pseudostate initialized as a choice pseudostate.
 Object buildSignalEvent(Object model)
          Builds a signalevent whose namespace (and therefore the ownership) is the rootmodel.
 Object buildSignalEvent(String name, Object model)
          Builds a named signalevent whose namespace (and therefore the ownership) is the rootmodel.
 Object buildSimpleState(Object compositeState)
          Builds a simplestate.
 Object buildStateMachine(Object oContext)
          Builds a state machine owned by the given context.
 Object buildStubState(Object compositeState)
          Builds a stubstate initalized with an empty referenced state.
 Object buildSubmachineState(Object compositeState)
          Builds a submachinestate.
 Object buildSynchState(Object compositeState)
          Builds a synchstate initalized with bound 0.
 Object buildTimeEvent(Object model)
          Builds a timeevent whose namespace (and therefore the ownership) is the rootmodel.
 Object buildTimeEvent(String s, Object model)
          Builds a timeevent whose namespace (and therefore the ownership) is the rootmodel.
 Object buildTransition(Object source, Object target)
          Build a transition between a source state and a target state.
 Object buildTransition(Object owningState, Object source, Object dest)
          Builds a complete transition including all associations (composite state the transition belongs to, source the transition is coming from, destination the transition is going to).
 Object createCallEvent()
          Create an empty but initialized instance of a UML CallEvent.
 Object createChangeEvent()
          Create an empty but initialized instance of a UML ChangeEvent.
 Object createCompositeState()
          Create an empty but initialized instance of a UML CompositeState.
 Object createFinalState()
          Create an empty but initialized instance of a UML FinalState.
 Object createGuard()
          Create an empty but initialized instance of a UML Guard.
 Object createPseudostate()
          Create an empty but initialized instance of a UML Pseudostate.
 Object createSignalEvent()
          Create an empty but initialized instance of a UML SignalEvent.
 Object createSimpleState()
          Create an empty but initialized instance of a UML SimpleState.
 Object createState()
          Create an empty but initialized instance of a UML State.
 Object createStateMachine()
          Create an empty but initialized instance of a UML StateMachine.
 Object createStubState()
          Create an empty but initialized instance of a UML StubState.
 Object createSubmachineState()
          Create an empty but initialized instance of a UML SubmachineState.
 Object createSynchState()
          Create an empty but initialized instance of a UML SynchState.
 Object createTimeEvent()
          Create an empty but initialized instance of a UML TimeEvent.
 Object createTransition()
          Create an empty but initialized instance of a UML Transition.
(package private)  void deleteCallEvent(Object elem)
           
(package private)  void deleteChangeEvent(Object elem)
           
(package private)  void deleteCompositeState(Object elem)
          Deletes any associated subVertices.
(package private)  void deleteEvent(Object elem)
           
(package private)  void deleteFinalState(Object elem)
           
(package private)  void deleteGuard(Object elem)
           
(package private)  void deletePseudostate(Object elem)
           
(package private)  void deleteSignalEvent(Object elem)
           
(package private)  void deleteSimpleState(Object elem)
           
(package private)  void deleteState(Object elem)
           
(package private)  void deleteStateMachine(Object elem)
          deletes its top state, which is a composite state (state vertex).
(package private)  void deleteStateVertex(Object elem)
          Deletes the outgoing and incoming transitions of a statevertex.
(package private)  void deleteStubState(Object elem)
           
(package private)  void deleteSubmachineState(Object elem)
           
(package private)  void deleteSynchState(Object elem)
           
(package private)  void deleteTimeEvent(Object elem)
           
(package private)  void deleteTransition(Object elem)
           
 
Methods inherited from class org.argouml.model.uml.AbstractUmlModelFactory
addListenersToModelElement, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nsmodel

private NSUMLModelImplementation nsmodel
The model implementation.

Constructor Detail

StateMachinesFactoryImpl

StateMachinesFactoryImpl(NSUMLModelImplementation implementation)
Don't allow instantiation.

Parameters:
implementation - To get other helpers and factories.
Method Detail

createCallEvent

public Object createCallEvent()
Create an empty but initialized instance of a UML CallEvent.

Specified by:
createCallEvent in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML CallEvent instance.

createChangeEvent

public Object createChangeEvent()
Create an empty but initialized instance of a UML ChangeEvent.

Specified by:
createChangeEvent in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML ChangeEvent instance.

createCompositeState

public Object createCompositeState()
Create an empty but initialized instance of a UML CompositeState.

Specified by:
createCompositeState in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML CompositeState instance.

createFinalState

public Object createFinalState()
Create an empty but initialized instance of a UML FinalState.

Specified by:
createFinalState in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML FinalState instance.

createGuard

public Object createGuard()
Create an empty but initialized instance of a UML Guard.

Specified by:
createGuard in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML Guard instance.

createPseudostate

public Object createPseudostate()
Create an empty but initialized instance of a UML Pseudostate.

Specified by:
createPseudostate in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML Pseudostate instance.

createSignalEvent

public Object createSignalEvent()
Create an empty but initialized instance of a UML SignalEvent.

Specified by:
createSignalEvent in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML SignalEvent instance.

createSimpleState

public Object createSimpleState()
Create an empty but initialized instance of a UML SimpleState.

Specified by:
createSimpleState in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML SimpleState instance.

createState

public Object createState()
Create an empty but initialized instance of a UML State.

Specified by:
createState in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML State instance.

createStateMachine

public Object createStateMachine()
Create an empty but initialized instance of a UML StateMachine.

Specified by:
createStateMachine in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML StateMachine instance.

createStubState

public Object createStubState()
Create an empty but initialized instance of a UML StubState.

Specified by:
createStubState in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML StubState instance.

createSubmachineState

public Object createSubmachineState()
Create an empty but initialized instance of a UML SubmachineState.

Specified by:
createSubmachineState in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML SubmachineState instance.

createSynchState

public Object createSynchState()
Create an empty but initialized instance of a UML SynchState.

Specified by:
createSynchState in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML SynchState instance.

createTimeEvent

public Object createTimeEvent()
Create an empty but initialized instance of a UML TimeEvent.

Specified by:
createTimeEvent in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML TimeEvent instance.

createTransition

public Object createTransition()
Create an empty but initialized instance of a UML Transition.

Specified by:
createTransition in interface org.argouml.model.StateMachinesFactory
Returns:
an initialized UML Transition instance.

buildCompositeStateOnStateMachine

public Object buildCompositeStateOnStateMachine(Object statemachine)
Builds a compositestate as top for some statemachine.

Specified by:
buildCompositeStateOnStateMachine in interface org.argouml.model.StateMachinesFactory
Parameters:
statemachine - the given statemachine
Returns:
MCompositeState the newly build top state
See Also:
buildCompositeState(Object)

buildStateMachine

public Object buildStateMachine(Object oContext)
Builds a state machine owned by the given context.

Specified by:
buildStateMachine in interface org.argouml.model.StateMachinesFactory
Parameters:
oContext - the given context
Returns:
MStateMachine the newly build statemachine

buildTransition

public Object buildTransition(Object owningState,
                              Object source,
                              Object dest)
Builds a complete transition including all associations (composite state the transition belongs to, source the transition is coming from, destination the transition is going to). The transition is owned by the compositestate.

Specified by:
buildTransition in interface org.argouml.model.StateMachinesFactory
Parameters:
owningState - the composite state that owns the transition
source - the source of the transition (a StateVertex)
dest - the destination of the transition (a StateVertex)
Returns:
The newly build Transition.

buildPseudoState

public Object buildPseudoState(Object compositeState)
Builds a pseudostate initialized as a choice pseudostate. The pseudostate will be a subvertix of the given compositestate. The parameter compositeState is of type Object to decouple the factory and NSUML as much as possible from the rest of ArgoUML.

Specified by:
buildPseudoState in interface org.argouml.model.StateMachinesFactory
Parameters:
compositeState - the parent
Returns:
MPseudostate

buildSynchState

public Object buildSynchState(Object compositeState)
Builds a synchstate initalized with bound 0. The synchstate will be a subvertix of the given compositestate. The parameter compositeState is of type Object to decouple the factory and NSUML as much as possible from the rest of ArgoUML.

Specified by:
buildSynchState in interface org.argouml.model.StateMachinesFactory
Parameters:
compositeState - the given compositestate
Returns:
MSynchState the newly created SynchState

buildStubState

public Object buildStubState(Object compositeState)
Builds a stubstate initalized with an empty referenced state. The stubstate will be a subvertix of the given compositestate. The parameter compositeState is of type Object to decouple the factory and NSUML as much as possible from the rest of ArgoUML.

Specified by:
buildStubState in interface org.argouml.model.StateMachinesFactory
Parameters:
compositeState - the given composite state
Returns:
MSynchState the newly build stubstate

buildCompositeState

public Object buildCompositeState(Object compositeState)
Builds a compositestate initalized as a non-concurrent composite state. The compositestate will be a subvertix of the given compositestate. The parameter compositeState is of type Object to decouple the factory and NSUML as much as possible from the rest of ArgoUML.

Specified by:
buildCompositeState in interface org.argouml.model.StateMachinesFactory
Parameters:
compositeState - the given compositestate
Returns:
MSynchState the newly build synchstate
See Also:
buildCompositeStateOnStateMachine(Object)

buildSimpleState

public Object buildSimpleState(Object compositeState)
Builds a simplestate. The simplestate will be a subvertix of the given compositestate. The parameter compositeState is of type Object to decouple the factory and NSUML as much as possible. from the rest of ArgoUML.

Specified by:
buildSimpleState in interface org.argouml.model.StateMachinesFactory
Parameters:
compositeState - the given compositestate
Returns:
MSimpleState the newly build simple state

buildFinalState

public Object buildFinalState(Object compositeState)
Builds a finalstate. The finalstate will be a subvertix of the given compositestate. The parameter compositeState is of type Object to decouple the factory and NSUML as much as possible. from the rest of ArgoUML.

Specified by:
buildFinalState in interface org.argouml.model.StateMachinesFactory
Parameters:
compositeState - the given compositestate
Returns:
MFinalState the given compositestate

buildSubmachineState

public Object buildSubmachineState(Object compositeState)
Builds a submachinestate. The submachinestate will be a subvertix of the given compositestate. The parameter compositeState is of type Object to decouple the factory and NSUML as much as possible. from the rest of ArgoUML.

Specified by:
buildSubmachineState in interface org.argouml.model.StateMachinesFactory
Parameters:
compositeState - the given compositestate
Returns:
MSubmachineState the given submachinestate

buildInternalTransition

public Object buildInternalTransition(Object state)
Builds an internal transition for a given state. The parameter state is of type Object to decouple the factory and NSUML as much as possible.

Specified by:
buildInternalTransition in interface org.argouml.model.StateMachinesFactory
Parameters:
state - The state the internal transition should belong to
Returns:
MTransition The internal transition constructed

buildTransition

public Object buildTransition(Object source,
                              Object target)
Build a transition between a source state and a target state. This should not be used for internal transitions!

Specified by:
buildTransition in interface org.argouml.model.StateMachinesFactory
Parameters:
source - The source state
target - The target state
Returns:
MTransition The resulting transition between source an state

buildCallEvent

public Object buildCallEvent(Object model)
Builds a callevent whose namespace (and therefore the ownership) is the rootmodel.

Specified by:
buildCallEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
model - the model
Returns:
MCallEvent

buildCallEvent

public Object buildCallEvent(Object trans,
                             String name,
                             Object model)
Create a initialized instance of a CallEvent with a name as a trigger for a Transition. If an operation with corresponding name can be found, it is linked.

Specified by:
buildCallEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
trans - Object MTransition for which the CallEvent is a trigger
name - String with the trigger name - should not include "()"
model - the model
Returns:
an initialized UML CallEvent instance.

buildSignalEvent

public Object buildSignalEvent(Object model)
Builds a signalevent whose namespace (and therefore the ownership) is the rootmodel.

Specified by:
buildSignalEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
model - the model
Returns:
MSignalEvent

buildSignalEvent

public Object buildSignalEvent(String name,
                               Object model)
Builds a named signalevent whose namespace (and therefore the ownership) is the rootmodel.

Specified by:
buildSignalEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
model - the model
name - String the name of the SignalEvent
Returns:
MSignalEvent

buildTimeEvent

public Object buildTimeEvent(Object model)
Builds a timeevent whose namespace (and therefore the ownership) is the rootmodel.

Specified by:
buildTimeEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
model - the Model
Returns:
MTimeEvent

buildTimeEvent

public Object buildTimeEvent(String s,
                             Object model)
Builds a timeevent whose namespace (and therefore the ownership) is the rootmodel.

Specified by:
buildTimeEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
s - String for creating the TimeExpression
model - the model
Returns:
MTimeEvent

buildChangeEvent

public Object buildChangeEvent(Object model)
Builds a changeevent whose namespace (and therefore the ownership) is the rootmodel.

Specified by:
buildChangeEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
model - the model
Returns:
MChangeEvent

buildChangeEvent

public Object buildChangeEvent(String s,
                               Object model)
Builds a changeevent whose namespace (and therefore the ownership) is the rootmodel.

Specified by:
buildChangeEvent in interface org.argouml.model.StateMachinesFactory
Parameters:
model - the model
s - String for creating the BooleanExpression
Returns:
MChangeEvent

buildGuard

public Object buildGuard(Object transition)
Builds a guard condition with a given transition. The guard condition is empty by default. The parameter is of type Object to decouple the factory and NSUML as much as possible.

Specified by:
buildGuard in interface org.argouml.model.StateMachinesFactory
Parameters:
transition - The transition that owns the resulting guard condition
Returns:
MGuard The resulting guard condition

deleteCallEvent

void deleteCallEvent(Object elem)
Parameters:
elem - the UML element to be deleted

deleteChangeEvent

void deleteChangeEvent(Object elem)
Parameters:
elem - the UML element to be deleted

deleteCompositeState

void deleteCompositeState(Object elem)
Deletes any associated subVertices.

Parameters:
elem - the UML element to be deleted

deleteEvent

void deleteEvent(Object elem)
Parameters:
elem - the UML element to be deleted

deleteFinalState

void deleteFinalState(Object elem)
Parameters:
elem - the UML element to be deleted

deleteGuard

void deleteGuard(Object elem)
Parameters:
elem - the UML element to be deleted

deletePseudostate

void deletePseudostate(Object elem)
Parameters:
elem - the UML element to be deleted

deleteSignalEvent

void deleteSignalEvent(Object elem)
Parameters:
elem - the UML element to be deleted

deleteSimpleState

void deleteSimpleState(Object elem)
Parameters:
elem - the UML element to be deleted

deleteState

void deleteState(Object elem)
Parameters:
elem - the UML element to be deleted

deleteStateMachine

void deleteStateMachine(Object elem)
deletes its top state, which is a composite state (state vertex).

Parameters:
elem - the state machine to be removed.

deleteStateVertex

void deleteStateVertex(Object elem)
Deletes the outgoing and incoming transitions of a statevertex.

Parameters:
elem - the UML element to be deleted

deleteStubState

void deleteStubState(Object elem)
Parameters:
elem - the UML element to be deleted

deleteSubmachineState

void deleteSubmachineState(Object elem)
Parameters:
elem - the UML element to be deleted

deleteSynchState

void deleteSynchState(Object elem)
Parameters:
elem - the UML element to be deleted

deleteTimeEvent

void deleteTimeEvent(Object elem)
Parameters:
elem - the UML element to be deleted

deleteTransition

void deleteTransition(Object elem)
Parameters:
elem - the UML element to be deleted


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook