org.argouml.ui
Class CmdCreateNode

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byorg.tigris.gef.base.Cmd
          extended byorg.tigris.gef.base.CmdCreateNode
              extended byorg.argouml.ui.CmdCreateNode
All Implemented Interfaces:
Action, ActionListener, Cloneable, EventListener, org.tigris.gef.graph.GraphFactory, Serializable
Direct Known Subclasses:
ActionAddObject, ActionCreatePseudostate

public class CmdCreateNode
extends org.tigris.gef.base.CmdCreateNode

Command to create nodes with the appropriate modelelement. The modelelement is initialized via the build methods on the uml factories. First we search for a buildMODELELEMENTNAME method without parameters. If that is not found we use the createMODELELEMENTNAME method.

See Also:
Model, ActivityGraphsFactory, CollaborationsFactory, CommonBehaviorFactory, CoreFactory, DataTypesFactory, ExtensionMechanismsFactory, ModelManagementFactory, StateMachinesFactory, UseCasesFactory, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private static String ACTION_PREFIX_KEY
          Prefix for the action key.
 
Fields inherited from class org.tigris.gef.base.CmdCreateNode
DEFAULT_NODE_CLASS
 
Fields inherited from class org.tigris.gef.base.Cmd
_args, _resource
 
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
CmdCreateNode(Class nodeClass, boolean sticky, String resource, String name)
          Constructor for CmdCreateNode.
CmdCreateNode(Class nodeClass, String resource, String name)
          Constructor for CmdCreateNode.
CmdCreateNode(Hashtable args, String name)
          Constructor for CmdCreateNode.
CmdCreateNode(Hashtable args, String resource, String name)
          Constructor for CmdCreateNode.
CmdCreateNode(Object nodeClass, boolean sticky, String name)
          Constructor for CmdCreateNode.
CmdCreateNode(Object nodeClass, String name)
          Constructor for CmdCreateNode.
 
Method Summary
 Object makeNode()
          Delegate creation of the node to the uml model subsystem.
private  void putToolTip(String name)
          Adds tooltip text to the Action.
 
Methods inherited from class org.tigris.gef.base.CmdCreateNode
doIt, getActiveGraphModel, makeEdge, makeGraphModel, undoIt
 
Methods inherited from class org.tigris.gef.base.Cmd
about, actionPerformed, cmdAtIndex, containsArg, getArg, getArg, getName, getResource, register, registeredCmds, setArg, setName, setResource, shouldBeEnabled, updateEnabled
 
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
 

Field Detail

ACTION_PREFIX_KEY

private static final String ACTION_PREFIX_KEY
Prefix for the action key.

See Also:
Constant Field Values
Constructor Detail

CmdCreateNode

public CmdCreateNode(Hashtable args,
                     String resource,
                     String name)
Constructor for CmdCreateNode.

Parameters:
args - a hastable of arguments
resource - for localizing the name
name - the to be localized tooltip name

CmdCreateNode

public CmdCreateNode(Hashtable args,
                     String name)
Constructor for CmdCreateNode.

Parameters:
args - a hastable of arguments
name - the to be localized name of the command = tooltip name

CmdCreateNode

public CmdCreateNode(Class nodeClass,
                     String resource,
                     String name)
Constructor for CmdCreateNode.

Parameters:
nodeClass - the class for which to create a node, and which to create itself
resource - for localizing the name
name - the tooltip name

CmdCreateNode

public CmdCreateNode(Object nodeClass,
                     String name)
Constructor for CmdCreateNode.

Parameters:
nodeClass - the class for which to create a node, and which to create itself
name - the tooltip name

CmdCreateNode

public CmdCreateNode(Class nodeClass,
                     boolean sticky,
                     String resource,
                     String name)
Constructor for CmdCreateNode.

Parameters:
nodeClass - the class for which to create a node, and which to create itself
sticky - the global sticky mode boolean allows the user to place several nodes rapidly (in succession)
resource - for localizing the name
name - the tooltip name

CmdCreateNode

public CmdCreateNode(Object nodeClass,
                     boolean sticky,
                     String name)
Constructor for CmdCreateNode.

Parameters:
nodeClass - the class for which to create a node, and which to create itself
sticky - the global sticky mode boolean allows the user to place several nodes rapidly (in succession)
name - the tooltip name
Method Detail

makeNode

public Object makeNode()
Delegate creation of the node to the uml model subsystem.

Returns:
an object which represents a particular UML Element.
See Also:
GraphFactory.makeNode(), CmdCreateNode.makeNode()

putToolTip

private void putToolTip(String name)
Adds tooltip text to the Action.

Parameters:
name - The key to localize as the name.


ArgoUML © 1996-2004 (20050222)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook