org.argouml.uml.ui
Class ActionAddDiagram

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.tigris.gef.undo.UndoableAction
          extended byorg.argouml.uml.ui.ActionAddDiagram
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable
Direct Known Subclasses:
ActionClassDiagram, ActionDeploymentDiagram, ActionUseCaseDiagram

public abstract class ActionAddDiagram
extends org.tigris.gef.undo.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.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ActionAddDiagram(String s)
          Constructor for ActionAddDiagram.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
abstract  UMLDiagram createDiagram(Object ns)
          Creates the diagram.
abstract  boolean isValidNamespace(Object ns)
          Test if the given namespace is a valid namespace to add the diagram to.
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionAddDiagram

public ActionAddDiagram(String s)
Constructor for ActionAddDiagram.

Parameters:
s - the name for this action
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
See Also:
ActionListener.actionPerformed(ActionEvent)

isValidNamespace

public abstract boolean isValidNamespace(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

public abstract UMLDiagram createDiagram(Object ns)
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


ArgoUML © 1996-2006ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook