org.argouml.uml.diagram.collaboration.ui
Class UMLCollaborationDiagram

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.collaboration.ui.UMLCollaborationDiagram
All Implemented Interfaces:
EventListener, GraphListener, PropertyChangeListener, Relocatable, Serializable

public class UMLCollaborationDiagram
extends UMLDiagram

The base class of the collaboration diagram.

Defines the toolbar, provides for its initialization and provides constructors for a top level diagram and one within a defined namespace.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.tigris.gef.base.Diagram
_comments, _name, _toolBar, NAME_KEY, SCALE_KEY
 
Constructor Summary
UMLCollaborationDiagram()
          This constructor is used to build a dummy collaboration diagram so that a project will load properly.
UMLCollaborationDiagram(Object collaboration)
          The constructor.
 
Method Summary
protected  Action getActionAssociation()
           
protected  Action getActionComposition()
           
protected  Action getActionDepend()
           
protected  Action getActionGeneralize()
           
protected  Action getActionUniAggregation()
           
protected  Action getActionUniAssociation()
           
protected  Action getActionUniComposition()
           
 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 new diagramname.
 int getNumMessages()
           
protected  Object[] getUmlActions()
          Get the actions from which to create a toolbar or equivalent graphic triggers.
 boolean isRelocationAllowed(Object base)
          This function should return true if it is allowed to relocate this type of diagram to the given modelelement.
 void postLoad()
          After loading the diagram it is necessary to connect every FigMessage to its FigAssociationRole.
 boolean relocate(Object base)
          Relocate this diagram, e.g.
 void setNamespace(Object handle)
          Method to perform a number of important initializations of a CollaborationDiagram.
 
Methods inherited from class org.argouml.uml.diagram.ui.UMLDiagram
deselectAllTools, getActions, getClassAndModelID, getJToolBar, getNamespace, getNextDiagramSerial, getOwner, getSelectedAction, initialize, initToolBar, makeCreateAssociationAction, makeCreateAssociationClassAction, makeCreateAssociationEndAction, makeCreateEdgeAction, makeCreateNodeAction, manageDefault, propertyChange, resetDiagramSerial, 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, 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

UMLCollaborationDiagram

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


UMLCollaborationDiagram

public UMLCollaborationDiagram(Object collaboration)
The constructor.

Parameters:
collaboration - the collaboration aka namespace for the diagram
Method Detail

getNumMessages

public int getNumMessages()
Returns:
the number of UML messages in the diagram

setNamespace

public void setNamespace(Object handle)
Method to perform a number of important initializations of a CollaborationDiagram.

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...

Overrides:
setNamespace in class UMLDiagram
Parameters:
handle - the collaboration from the UML model

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()

postLoad

public void postLoad()
After loading the diagram it is necessary to connect every FigMessage to its FigAssociationRole. This is done by adding the FigMessage to the PathItems of its FigAssociationRole.


getNewDiagramName

protected String getNewDiagramName()
Creates a new diagramname.

Returns:
String

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()

getActionAssociation

protected Action getActionAssociation()
Returns:
Returns the actionAssociation.

getActionComposition

protected Action getActionComposition()
Returns:
Returns the actionComposition.

getActionDepend

protected Action getActionDepend()
Returns:
Returns the actionDepend.

getActionGeneralize

protected Action getActionGeneralize()
Returns:
Returns the actionGeneralize.

getActionUniAggregation

protected Action getActionUniAggregation()
Returns:
Returns the actionUniAggregation.

getActionUniAssociation

protected Action getActionUniAssociation()
Returns:
Returns the actionUniAssociation.

getActionUniComposition

protected Action getActionUniComposition()
Returns:
Returns the actionUniComposition.

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