org.argouml.uml.ui
Class ActionAddDiagram

java.lang.Object
  extended by UndoableAction
      extended by org.argouml.uml.ui.ActionAddDiagram
Direct Known Subclasses:
ActionClassDiagram, ActionDeploymentDiagram, ActionUseCaseDiagram

public abstract class ActionAddDiagram
extends UndoableAction

Abstract class that is the parent of all actions adding diagrams to ArgoUML. The children of this class should implement createDiagram to do any specific actions for creating a diagram and isValidNamespace that checks if some namespace is valid to add the diagram to.

ArgoUML shall never create a diagram for a read-only modelelement.

TODO: This class should be merged with ActionNewDiagram.


Constructor Summary
ActionAddDiagram(java.lang.String s)
          Constructor for ActionAddDiagram.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 ArgoDiagram createDiagram(java.lang.Object ns)
          Deprecated. for 0.27.3 by tfmorris. Subclasses should override createDiagram(Object, DiagramSettings). This method is no longer abstract, so implementing classes may remove it.
 ArgoDiagram createDiagram(java.lang.Object owner, DiagramSettings settings)
          Create a new diagram.
protected  java.lang.Object findNamespace()
          Find the right namespace for the diagram.
abstract  boolean isValidNamespace(java.lang.Object ns)
          Test if the given namespace is a valid namespace to add the diagram to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionAddDiagram

public ActionAddDiagram(java.lang.String s)
Constructor for ActionAddDiagram.

Parameters:
s - the name for this action
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

findNamespace

protected java.lang.Object findNamespace()
Find the right namespace for the diagram.

Returns:
the namespace or null

isValidNamespace

public abstract boolean isValidNamespace(java.lang.Object ns)
Test if the given namespace is a valid namespace to add the diagram to.

Parameters:
ns - the namespace to check
Returns:
Returns true if valid.

createDiagram

@Deprecated
public ArgoDiagram createDiagram(java.lang.Object ns)
Deprecated. for 0.27.3 by tfmorris. Subclasses should override createDiagram(Object, DiagramSettings). This method is no longer abstract, so implementing classes may remove it.

Creates the diagram. Classes derived from this class should implement any specific behaviour to create the diagram.

Parameters:
ns - The namespace the UMLDiagram should get.
Returns:
UMLDiagram

createDiagram

public ArgoDiagram createDiagram(java.lang.Object owner,
                                 DiagramSettings settings)
Create a new diagram. To be implemented by subclasses. It will become abstract after 0.28 to enforce this requirement.

Parameters:
owner - owner of the diagram. May be a namespace, statemachine, or collaboration depending on the type of diagram.
settings - default rendering settings for all figs in the new diagram
Returns:
newly created diagram


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook