org.argouml.sequence2.diagram
Class UMLSequenceDiagram

java.lang.Object
  extended by Diagram
      extended by org.argouml.uml.diagram.ArgoDiagramImpl
          extended by org.argouml.uml.diagram.ui.UMLDiagram
              extended by org.argouml.sequence2.diagram.UMLSequenceDiagram
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.beans.VetoableChangeListener, java.util.EventListener, ArgoEventListener, ArgoDiagramAppearanceEventListener, ArgoNotationEventListener, ArgoDiagram, Relocatable, SequenceDiagram, IItemUID

public class UMLSequenceDiagram
extends UMLDiagram
implements SequenceDiagram

The diagram for sequence diagrams.


Field Summary
 
Fields inherited from class org.argouml.uml.diagram.ArgoDiagramImpl
namespace
 
Fields inherited from interface org.argouml.uml.diagram.ArgoDiagram
NAME_KEY, NAMESPACE_KEY
 
Constructor Summary
UMLSequenceDiagram()
          Deprecated. for 0.28 by tfmorris. Use #UMLActivityDiagram(String, Object, GraphModel).
UMLSequenceDiagram(java.lang.Object collaboration)
          Creates a new UmlSequenceDiagram with a collaboration.
 
Method Summary
 DiagramElement createDiagramElement(java.lang.Object modelElement, java.awt.Rectangle bounds)
          Create a diagram element suitable for the base diagram type
 boolean doesAccept(java.lang.Object objectToAccept)
          A sequence diagram can accept all classifiers.
 void encloserChanged(FigNode enclosed, FigNode oldEncloser, FigNode newEncloser)
          Called when the user releases a dragged FigNode.
 java.lang.Object getCollaboration()
           
 java.lang.String getInstructions(java.lang.Object droppedObject)
          Gets the instructions to be displayed on the status bar.
 java.lang.String getLabelName()
          Get the localized label name for the diagram
 ModePlace getModePlace(GraphFactory gf, java.lang.String instructions)
          Creates a diagram specific @see org.tigris.gef.base.ModePlace that allows the diagram to place an accepted type of object [ @see #doesAccept(Object) ] as it should.
 java.util.Collection getRelocationCandidates(java.lang.Object root)
          Create a collection of candidate modelelements to relocate this diagram to.
protected  java.lang.Object[] getUmlActions()
          Get the Uml actions that can be performed in the diagram
 void initialize(java.lang.Object owner)
          Method called by PGML parser during diagram load to initialize a diagram.
 boolean isRelocationAllowed(java.lang.Object base)
          This function should return true if it is allowed to relocate this type of diagram to the given modelelement.
 void postLoad()
          Ensure that all elements represented in this diagram are part of this diagrams collaboration
 boolean relocate(java.lang.Object base)
          Relocate this diagram, e.g.
 
Methods inherited from class org.argouml.uml.diagram.ui.UMLDiagram
createNaryAssociationNode, deselectAllTools, drop, getActions, getClassAndModelID, getJToolBar, getNewDiagramName, getNextDiagramSerial, getSelectedAction, initToolBar, makeCreateAssociationAction, makeCreateAssociationClassAction, makeCreateAssociationEndAction, makeCreateDependencyAction, makeCreateEdgeAction, makeCreateGeneralizationAction, makeCreateNodeAction, resetDiagramSerial, setProject, setSelectedAction
 
Methods inherited from class org.argouml.uml.diagram.ArgoDiagramImpl
damage, diagramFontChanged, getContainingFig, getDependentElement, getDiagramSettings, getEdges, getFigIterator, getItemUID, getNamespace, getNodes, getOwner, getProject, getVetoMessage, notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved, presentationsFor, propertyChange, remove, renderingChanged, repair, setDiagramSettings, setItemUID, setModelElementNamespace, setName, setNamespace, toString, vetoableChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.argouml.uml.diagram.ArgoDiagram
add, addPropertyChangeListener, addVetoableChangeListener, countContained, damage, getContainingFig, getDependentElement, getDiagramSettings, getEdges, getFigIterator, getGraphModel, getItemUID, getLayer, getName, getNamespace, getNodes, getOwner, getProject, getVetoMessage, postSave, preSave, presentationFor, presentationsFor, propertyChange, remove, removePropertyChangeListener, removeVetoableChangeListener, repair, setDiagramSettings, setItemUID, setModelElementNamespace, setName, setNamespace, setProject
 
Methods inherited from interface org.argouml.application.events.ArgoNotationEventListener
notationAdded, notationChanged, notationProviderAdded, notationProviderRemoved, notationRemoved
 
Methods inherited from interface org.argouml.application.events.ArgoDiagramAppearanceEventListener
diagramFontChanged
 

Constructor Detail

UMLSequenceDiagram

@Deprecated
public UMLSequenceDiagram()
Deprecated. for 0.28 by tfmorris. Use #UMLActivityDiagram(String, Object, GraphModel).

TODO: Document!


UMLSequenceDiagram

public UMLSequenceDiagram(java.lang.Object collaboration)
Creates a new UmlSequenceDiagram with a collaboration.

Parameters:
collaboration - The collaboration
Method Detail

initialize

public void initialize(java.lang.Object owner)
Method called by PGML parser during diagram load to initialize a diagram. We are passed the owner of that diagram which is the collaboration.

Overrides:
initialize in class UMLDiagram
Parameters:
owner - UML model element representing the collaboration
See Also:
org.tigris.gef.base.Diagram#initialize(java.lang.Object)

getUmlActions

protected java.lang.Object[] getUmlActions()
Get the Uml actions that can be performed in the diagram

Specified by:
getUmlActions in class UMLDiagram
Returns:
An array with the Uml actions
See Also:
UMLDiagram.getUmlActions()

getLabelName

public java.lang.String getLabelName()
Get the localized label name for the diagram

Specified by:
getLabelName in class UMLDiagram
Returns:
The localized label name for the diagram
See Also:
UMLDiagram.getLabelName()

encloserChanged

public void encloserChanged(FigNode enclosed,
                            FigNode oldEncloser,
                            FigNode newEncloser)
Description copied from interface: ArgoDiagram
Called when the user releases a dragged FigNode.

Specified by:
encloserChanged in interface ArgoDiagram
Specified by:
encloserChanged in class ArgoDiagramImpl
Parameters:
enclosed - the enclosed FigNode that was dragged into the encloser
oldEncloser - the previous encloser
newEncloser - the FigNode that encloses the dragged FigNode

isRelocationAllowed

public boolean isRelocationAllowed(java.lang.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
Parameters:
base - the given modelelement
Returns:
true if adding a diagram here is allowed

getRelocationCandidates

public java.util.Collection getRelocationCandidates(java.lang.Object root)
Description copied from interface: Relocatable
Create a collection of candidate modelelements to relocate this diagram to. All candidates belong to a given namespace - e.g. the root Model.

Specified by:
getRelocationCandidates in interface Relocatable
Parameters:
root - all returned candidates are contained in this namespace
Returns:
the collection of candidate modelelements to which this diagram may be relocated

relocate

public boolean relocate(java.lang.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
Parameters:
base - the new location, i.e. base modelelement
Returns:
true if successful

doesAccept

public boolean doesAccept(java.lang.Object objectToAccept)
A sequence diagram can accept all classifiers. It will add them as a new Classifier Role with that classifier as a base.

Overrides:
doesAccept in class UMLDiagram
Parameters:
objectToAccept - element to test for acceptability
Returns:
true if the element is acceptable
See Also:
UMLDiagram.doesAccept(java.lang.Object)

createDiagramElement

public DiagramElement createDiagramElement(java.lang.Object modelElement,
                                           java.awt.Rectangle bounds)
Description copied from interface: ArgoDiagram
Create a diagram element suitable for the base diagram type

Specified by:
createDiagramElement in interface ArgoDiagram
Parameters:
modelElement - the model element the diagram element will represent
bounds - the bounds of the newly created diagram element
Returns:
the newly created diagram element.

getInstructions

public java.lang.String getInstructions(java.lang.Object droppedObject)
Description copied from class: UMLDiagram
Gets the instructions to be displayed on the status bar.

Overrides:
getInstructions in class UMLDiagram
Parameters:
droppedObject - The object for which instructions will be given.
Returns:
The instructions.

getModePlace

public ModePlace getModePlace(GraphFactory gf,
                              java.lang.String instructions)
Description copied from class: UMLDiagram
Creates a diagram specific @see org.tigris.gef.base.ModePlace that allows the diagram to place an accepted type of object [ @see #doesAccept(Object) ] as it should. This is required 1. since a diagram may receive an object that can't be placed as is, but needs some transformation and 2. diagrams in modules should be independent from the main app, and should use their own implementation of ModePlace if it's required.

Overrides:
getModePlace in class UMLDiagram
Parameters:
gf - TODO
instructions - a help string for the user
Returns:
The created ModePlace.

getCollaboration

public java.lang.Object getCollaboration()
Specified by:
getCollaboration in interface SequenceDiagram
Returns:
the collaboration from the associated graph model

postLoad

public void postLoad()
Ensure that all elements represented in this diagram are part of this diagrams collaboration

Specified by:
postLoad in interface ArgoDiagram
See Also:
org.tigris.gef.base.Diagram#postLoad()


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook