org.tigris.gef.base
Class CmdSetMode

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

public class CmdSetMode
extends Cmd

Cmd that sets the next global editor mode. The global editor mode effects the next editor that you move the mouse into. For example, in PaletteFig the Line button sets the next global mode to ModeCreateFigLine.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable _modeArgs
          Arguments to pass to the new mode instance after creation.
 
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
CmdSetMode(java.lang.Class modeClass)
          Set the next global mode to the named mode.
CmdSetMode(java.lang.Class modeClass, boolean sticky)
          Set the next global mode to the named mode, and maybe make it sticky.
CmdSetMode(java.lang.Class modeClass, java.util.Hashtable modeArgs)
          Set the next global mode to the named mode, and set all arguments.
CmdSetMode(java.lang.Class modeClass, java.lang.String name)
           
CmdSetMode(java.lang.Class modeClass, java.lang.String arg, java.lang.Object value)
           
CmdSetMode(java.lang.Class modeClass, java.lang.String arg, java.lang.Object value, java.lang.String name)
           
CmdSetMode(java.lang.Class modeClass, java.lang.String arg, java.lang.Object value, java.lang.String name, javax.swing.ImageIcon icon)
           
CmdSetMode(java.util.Properties args)
           
 
Method Summary
 void doIt()
          Perform whatever Cmd this Cmd is meant to do.
 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

_modeArgs

protected java.util.Hashtable _modeArgs
Arguments to pass to the new mode instance after creation.

Constructor Detail

CmdSetMode

public CmdSetMode(java.util.Properties args)

CmdSetMode

public CmdSetMode(java.lang.Class modeClass)
Set the next global mode to the named mode.


CmdSetMode

public CmdSetMode(java.lang.Class modeClass,
                  java.lang.String name)

CmdSetMode

public CmdSetMode(java.lang.Class modeClass,
                  boolean sticky)
Set the next global mode to the named mode, and maybe make it sticky.


CmdSetMode

public CmdSetMode(java.lang.Class modeClass,
                  java.util.Hashtable modeArgs)
Set the next global mode to the named mode, and set all arguments.


CmdSetMode

public CmdSetMode(java.lang.Class modeClass,
                  java.lang.String arg,
                  java.lang.Object value)

CmdSetMode

public CmdSetMode(java.lang.Class modeClass,
                  java.lang.String arg,
                  java.lang.Object value,
                  java.lang.String name)

CmdSetMode

public CmdSetMode(java.lang.Class modeClass,
                  java.lang.String arg,
                  java.lang.Object value,
                  java.lang.String name,
                  javax.swing.ImageIcon icon)
Method Detail

doIt

public void doIt()
Description copied from class: Cmd
Perform whatever Cmd this Cmd is meant to do. Subclasses should override this to do whatever is intended. When the Cmd executes, it should store enough information to undo itself later if needed.

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