org.tigris.gef.base
Class CmdReorder

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

public class CmdReorder
extends Cmd

Cmd to change the back-to-front ordering of Fig's.

See Also:
LayerDiagram.reorder(org.tigris.gef.presentation.Fig, int), Serialized Form

Field Summary
static int BRING_FORWARD
           
static int BRING_TO_FRONT
           
static CmdReorder BringForward
           
static CmdReorder BringToFront
           
static int SEND_BACKWARD
           
static int SEND_TO_BACK
           
static CmdReorder SendBackward
           
static CmdReorder SendToBack
           
 
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
CmdReorder(int f)
          Construct a new CmdReorder with the given reordering constrant (see above)
 
Method Summary
 void doIt()
          Perform whatever Cmd this Cmd is meant to do.
 void undoIt()
          Undo the Cmd using information stored during its execution.
protected static java.lang.String wordFor(int f)
           
 
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

SEND_TO_BACK

public static final int SEND_TO_BACK
See Also:
Constant Field Values

BRING_TO_FRONT

public static final int BRING_TO_FRONT
See Also:
Constant Field Values

SEND_BACKWARD

public static final int SEND_BACKWARD
See Also:
Constant Field Values

BRING_FORWARD

public static final int BRING_FORWARD
See Also:
Constant Field Values

SendToBack

public static CmdReorder SendToBack

BringToFront

public static CmdReorder BringToFront

SendBackward

public static CmdReorder SendBackward

BringForward

public static CmdReorder BringForward
Constructor Detail

CmdReorder

public CmdReorder(int f)
Construct a new CmdReorder with the given reordering constrant (see above)

Method Detail

wordFor

protected static java.lang.String wordFor(int f)

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