org.argouml.uml.ui
Class ActionNewDiagram

java.lang.Object
  extended by UndoableAction
      extended by org.argouml.uml.ui.ActionNewDiagram
Direct Known Subclasses:
ActionActivityDiagram, ActionCollaborationDiagram, ActionSequenceDiagram, ActionStateDiagram

public abstract class ActionNewDiagram
extends UndoableAction

Abstract action to trigger creation of a new diagram.

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

TODO: Bobs says, can we merge ActionAddDiagram with this class?


Constructor Summary
protected ActionNewDiagram(java.lang.String name)
          The constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected static java.lang.Object createCollaboration(java.lang.Object namespace)
          Utility function to create a collaboration.
protected  ArgoDiagram createDiagram(java.lang.Object namespace)
          Deprecated. for 0.29.1 by tfmorris. Use createDiagram(Object, DiagramSettings)/
protected abstract  ArgoDiagram createDiagram(java.lang.Object namespace, DiagramSettings settings)
           
protected  java.lang.Object findNamespace()
          Find the right namespace for the diagram.
 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

ActionNewDiagram

protected ActionNewDiagram(java.lang.String name)
The constructor.

Parameters:
name - the i18n key for this action name.
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

createDiagram

@Deprecated
protected ArgoDiagram createDiagram(java.lang.Object namespace)
Deprecated. for 0.29.1 by tfmorris. Use createDiagram(Object, DiagramSettings)/

Parameters:
namespace - the namespace in which to create the diagram
Returns:
the new diagram

createDiagram

protected abstract ArgoDiagram createDiagram(java.lang.Object namespace,
                                             DiagramSettings settings)
Parameters:
namespace - the namespace in which to create the diagram
settings - the render settings for the diagram
Returns:
the new diagram

isValidNamespace

public boolean isValidNamespace(java.lang.Object ns)
Test if the given namespace is a valid namespace to add the diagram to. TODO: This method was created to facilitate the merge of this class with ActionAddDiagram.

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

createCollaboration

protected static java.lang.Object createCollaboration(java.lang.Object namespace)
Utility function to create a collaboration.

Parameters:
namespace - the back-up namespace to put the collaboration in
Returns:
a new collaboration


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook