org.argouml.uml.diagram.state.ui
Class UMLStateDiagram

java.lang.Object
  extended byorg.tigris.gef.base.Diagram
      extended byorg.argouml.ui.ArgoDiagram
          extended byorg.argouml.uml.diagram.ui.UMLDiagram
              extended byorg.argouml.uml.diagram.state.ui.UMLStateDiagram
All Implemented Interfaces:
EventListener, GraphListener, PropertyChangeListener, Relocatable, Serializable

public class UMLStateDiagram
extends UMLDiagram

The UML Statechart diagram.

The correct name for this class would be "UMLStatechartDiagram". See issue 2306.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.tigris.gef.base.Diagram
_comments, _name, _toolBar, NAME_KEY, SCALE_KEY
 
Constructor Summary
UMLStateDiagram()
          This constructor is used to build a dummy statechart diagram so that a project will load properly.
UMLStateDiagram(Object namespace, Object machine)
          Constructor.
 
Method Summary
protected  Action getActionBranchPseudoState()
          Deprecated. use getActionChoicePseudoState
protected  Action getActionChoicePseudoState()
           
protected  Action getActionCompositeState()
           
protected  Action getActionDeepHistoryPseudoState()
           
protected  Action getActionFinalPseudoState()
           
protected  Action getActionForkPseudoState()
           
protected  Action getActionJoinPseudoState()
           
protected  Action getActionJunctionPseudoState()
           
protected  Action getActionShallowHistoryPseudoState()
           
protected  Action getActionStartPseudoState()
           
protected  Action getActionState()
           
protected  Action getActionStubState()
           
protected  Action getActionSubmachineState()
           
protected  Action getActionSynchState()
           
protected  Action getActionTransition()
           
 Object getDependentElement()
          This method shall return any UML modelelements that should be deleted when the diagram gets deleted, or null if there are none.
 String getLabelName()
           
protected  String getNewDiagramName()
          Creates a name for the diagram.
 Object getOwner()
          The owner of a statechart diagram is the statemachine it's showing.
 Object getStateMachine()
           
protected  Object[] getUmlActions()
          Get the actions from which to create a toolbar or equivalent graphic triggers.
 void initialize(Object o)
          Called by the PGML parser to initialize the statechart diagram.
 boolean isRelocationAllowed(Object base)
          This function should return true if it is allowed to relocate this type of diagram to the given modelelement.
 void propertyChange(PropertyChangeEvent evt)
          This diagram listens to events from its namespace ModelElement; when the modelelement is removed, we also want to delete this diagram.
 boolean relocate(Object base)
          Relocate this diagram, e.g.
 void setStateMachine(Object sm)
           
 void setup(Object namespace, Object machine)
          Method to perform a number of important initializations of a StateDiagram.
 
Methods inherited from class org.argouml.uml.diagram.ui.UMLDiagram
deselectAllTools, getActions, getClassAndModelID, getJToolBar, getNamespace, getNextDiagramSerial, getSelectedAction, initToolBar, makeCreateAssociationAction, makeCreateAssociationClassAction, makeCreateAssociationEndAction, makeCreateEdgeAction, makeCreateNodeAction, manageDefault, resetDiagramSerial, setNamespace, setSelectedAction
 
Methods inherited from class org.argouml.ui.ArgoDiagram
damage, getContainingFig, getEdges, getItemUID, getNodes, getVetoMessage, presentationsFor, remove, repair, setItemUID, setName, toString
 
Methods inherited from class org.tigris.gef.base.Diagram
add, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, bringForward, bringToFront, countContained, edgeAdded, edgeRemoved, elements, elementsIn, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getComments, getGraphController, getGraphModel, getLayer, getName, getScale, getShowSingleMultiplicity, getToolBar, graphChanged, hit, nodeAdded, nodeRemoved, postLoad, postSave, preSave, presentationFor, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, reorder, sendBackward, sendToBack, setComments, setGraphModel, setLayer, setScale, setShowSingleMultiplicity, setToolBar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UMLStateDiagram

public UMLStateDiagram()
This constructor is used to build a dummy statechart diagram so that a project will load properly.


UMLStateDiagram

public UMLStateDiagram(Object namespace,
                       Object machine)
Constructor.

Parameters:
namespace - the NameSpace for the new diagram
machine - the StateMachine for the new diagram
Method Detail

getOwner

public Object getOwner()
The owner of a statechart diagram is the statemachine it's showing.

Overrides:
getOwner in class UMLDiagram
Returns:
the namespace
See Also:
UMLDiagram.getOwner()

initialize

public void initialize(Object o)
Called by the PGML parser to initialize the statechart diagram. First the parser creates a statechart diagram via the default constructor. Then this method is called.

Overrides:
initialize in class UMLDiagram
See Also:
Diagram.initialize(Object)

setup

public void setup(Object namespace,
                  Object machine)
Method to perform a number of important initializations of a StateDiagram.

Each diagram type has a similar UMLxxxDiagram class.

Changed lay from LayerPerspective to LayerPerspectiveMutable. This class is a child of LayerPerspective and was implemented to correct some difficulties in changing the model. lay is used mainly in LayerManager(GEF) to control the adding, changing and deleting layers on the diagram...

Parameters:
namespace - Class from the UML model...connects the class to the Statechart diagram.
machine - StateMachine from the UML model

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Description copied from class: UMLDiagram
This diagram listens to events from its namespace ModelElement; when the modelelement is removed, we also want to delete this diagram.

There is also a risk that if this diagram was the one shown in the diagram panel, then it will remain after it has been deleted. So we need to deselect this diagram. There are other things to take care of, so all this is delegated to Project.moveToTrash(Object).

Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class UMLDiagram
See Also:
UMLDiagram.propertyChange(java.beans.PropertyChangeEvent)

getStateMachine

public Object getStateMachine()
Returns:
the StateMachine belonging to this diagram

setStateMachine

public void setStateMachine(Object sm)
Parameters:
sm - Set the StateMachine for this diagram.

getUmlActions

protected Object[] getUmlActions()
Get the actions from which to create a toolbar or equivalent graphic triggers.

Specified by:
getUmlActions in class UMLDiagram
Returns:
the actions structure
See Also:
UMLDiagram.getUmlActions()

getNewDiagramName

protected String getNewDiagramName()
Creates a name for the diagram.

Returns:
the new diagram name

getLabelName

public String getLabelName()
Specified by:
getLabelName in class UMLDiagram
Returns:
a string that can be used as a label for this kind of diagram
See Also:
UMLDiagram.getLabelName()

getActionBranchPseudoState

protected Action getActionBranchPseudoState()
Deprecated. use getActionChoicePseudoState

Returns:
Returns the actionBranchPseudoState.

getActionChoicePseudoState

protected Action getActionChoicePseudoState()
Returns:
Returns the actionChoicePseudoState.

getActionCompositeState

protected Action getActionCompositeState()
Returns:
Returns the actionCompositeState.

getActionDeepHistoryPseudoState

protected Action getActionDeepHistoryPseudoState()
Returns:
Returns the actionDeepHistoryPseudoState.

getActionFinalPseudoState

protected Action getActionFinalPseudoState()
Returns:
Returns the actionFinalPseudoState.

getActionForkPseudoState

protected Action getActionForkPseudoState()
Returns:
Returns the actionForkPseudoState.

getActionJoinPseudoState

protected Action getActionJoinPseudoState()
Returns:
Returns the actionJoinPseudoState.

getActionJunctionPseudoState

protected Action getActionJunctionPseudoState()
Returns:
Returns the actionJunctionPseudoState.

getActionShallowHistoryPseudoState

protected Action getActionShallowHistoryPseudoState()
Returns:
Returns the actionShallowHistoryPseudoState.

getActionStartPseudoState

protected Action getActionStartPseudoState()
Returns:
Returns the actionStartPseudoState.

getActionState

protected Action getActionState()
Returns:
Returns the actionState.

getActionSynchState

protected Action getActionSynchState()
Returns:
Returns the actionSynchState.

getActionSubmachineState

protected Action getActionSubmachineState()
Returns:
Returns the actionSubmachineState.

getActionStubState

protected Action getActionStubState()
Returns:
Returns the actionSubmachineState.

getActionTransition

protected Action getActionTransition()
Returns:
Returns the actionTransition.

getDependentElement

public Object getDependentElement()
Description copied from class: UMLDiagram
This method shall return any UML modelelements that should be deleted when the diagram gets deleted, or null if there are none. The default implementation returns null; e.g. a statechart diagram should return its statemachine.

Overrides:
getDependentElement in class UMLDiagram
Returns:
the dependent element - in the general case there aren't, so null
See Also:
UMLDiagram.getDependentElement()

isRelocationAllowed

public boolean isRelocationAllowed(Object base)
Description copied from interface: Relocatable
This function should return true if it is allowed to relocate this type of diagram to the given modelelement.

Specified by:
isRelocationAllowed in interface Relocatable
Specified by:
isRelocationAllowed in class UMLDiagram
See Also:
UMLDiagram.isRelocationAllowed(java.lang.Object)

relocate

public boolean relocate(Object base)
Description copied from interface: Relocatable
Relocate this diagram, e.g. for a class diagram assign it a new namespace, e.g. for a statechart move it together with the statemachine to a new operation/classifier.

Precondition: isRelocationAllowed(base) is true.

Specified by:
relocate in interface Relocatable
Specified by:
relocate in class UMLDiagram
See Also:
UMLDiagram.relocate(java.lang.Object)


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook