org.argouml.uml.ui
Class ActionAddDiagram

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.argouml.uml.ui.UMLAction
          extended byorg.argouml.uml.ui.ActionAddDiagram
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, Serializable
Direct Known Subclasses:
ActionActivityDiagram, ActionClassDiagram, ActionCollaborationDiagram, ActionDeploymentDiagram, ActionStateDiagram, ActionUseCaseDiagram

public abstract class ActionAddDiagram
extends UMLAction

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

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private static Logger LOG
          Logger.
 
Fields inherited from class org.argouml.uml.ui.UMLAction
HAS_ICON, NO_ICON
 
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)
          Perform the work the action is supposed to do.
abstract  UMLDiagram createDiagram(Object ns)
          Creates the diagram.
private  Object findNamespace()
          Find the right namespace for 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 org.argouml.uml.ui.UMLAction
getMnemonic, getValue, isEnabled, putValue, shouldBeEnabled, updateEnabled, updateEnabled
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Logger LOG
Logger.

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)
Description copied from class: UMLAction
Perform the work the action is supposed to do. This method needs to be overridden by all actions, since it only shows a fake progressbar...

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class UMLAction
See Also:
ActionListener.actionPerformed(ActionEvent)

findNamespace

private Object findNamespace()
Find the right namespace for the diagram.

Returns:
the namespace or null

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-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook