org.tigris.gef.base
Class CmdCreateNode

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.tigris.gef.base.Cmd
          extended by org.tigris.gef.base.CmdCreateNode
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, GraphFactory

public class CmdCreateNode
extends Cmd
implements GraphFactory

See Also:
Serialized Form

Field Summary
static java.lang.Class 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(java.lang.Class nodeClass, boolean sticky, java.lang.String name)
           
CmdCreateNode(java.lang.Class nodeClass, boolean sticky, java.lang.String resource, java.lang.String name)
          Construct a new Cmd with the given classes for the NetNode and its FigNode, and set the global sticky mode boolean to the given value.
CmdCreateNode(java.lang.Class nodeClass, java.lang.String name)
           
CmdCreateNode(java.lang.Class nodeClass, java.lang.String resource, java.lang.String name)
          Construct a new Cmd with the given classes for the NetNode and its FigNode.
CmdCreateNode(java.util.Hashtable args, java.lang.String name)
           
CmdCreateNode(java.util.Hashtable args, java.lang.String resource, java.lang.String name)
          Construct a new Cmd with the given arguments for node class.
 
Method Summary
 void doIt()
          Actually instanciate the NetNode and FigNode objects and set the global next mode to ModePlace
 java.lang.Object getActiveGraphModel()
           
 java.lang.Object makeEdge()
           
 GraphModel makeGraphModel()
           
 java.lang.Object makeNode()
          Factory method for creating a new NetNode from the className argument.
 void undoIt()
          Undo the Cmd using information stored during its execution.
 
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

DEFAULT_NODE_CLASS

public static java.lang.Class DEFAULT_NODE_CLASS
Constructor Detail

CmdCreateNode

public CmdCreateNode(java.util.Hashtable args,
                     java.lang.String resource,
                     java.lang.String name)
Construct a new Cmd with the given arguments for node class.


CmdCreateNode

public CmdCreateNode(java.util.Hashtable args,
                     java.lang.String name)

CmdCreateNode

public CmdCreateNode(java.lang.Class nodeClass,
                     java.lang.String resource,
                     java.lang.String name)
Construct a new Cmd with the given classes for the NetNode and its FigNode.


CmdCreateNode

public CmdCreateNode(java.lang.Class nodeClass,
                     java.lang.String name)

CmdCreateNode

public CmdCreateNode(java.lang.Class nodeClass,
                     boolean sticky,
                     java.lang.String resource,
                     java.lang.String name)
Construct a new Cmd with the given classes for the NetNode and its FigNode, and set the global sticky mode boolean to the given value. This allows the user to place several nodes rapidly.


CmdCreateNode

public CmdCreateNode(java.lang.Class nodeClass,
                     boolean sticky,
                     java.lang.String name)
Method Detail

doIt

public void doIt()
Actually instanciate the NetNode and FigNode objects and set the global next mode to ModePlace

Specified by:
doIt in class Cmd

undoIt

public void undoIt()
Description copied from class: Cmd
Undo the Cmd using information stored during its execution.

TODO Abandon this. We need the memento pattern for undo

Specified by:
undoIt in class Cmd

makeGraphModel

public GraphModel makeGraphModel()
Specified by:
makeGraphModel in interface GraphFactory

makeEdge

public java.lang.Object makeEdge()
Specified by:
makeEdge in interface GraphFactory

makeNode

public java.lang.Object makeNode()
Factory method for creating a new NetNode from the className argument. TODO This returns null on error. We need to define some basic exception classes.

Specified by:
makeNode in interface GraphFactory

getActiveGraphModel

public java.lang.Object getActiveGraphModel()