org.tigris.gef.base
Class CmdAlign
java.lang.Object
javax.swing.AbstractAction
org.tigris.gef.base.Cmd
org.tigris.gef.base.CmdAlign
- All Implemented Interfaces:
- javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable
- public class CmdAlign
- extends Cmd
An Cmd to align 2 or more objects relative to each other.
- See Also:
- Serialized Form
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 |
CmdAlign(int dir)
Construct a new CmdAlign. |
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 d)
|
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 |
ALIGN_TOPS
public static final int ALIGN_TOPS
- Constants specifying the type of alignment requested.
- See Also:
- Constant Field Values
ALIGN_BOTTOMS
public static final int ALIGN_BOTTOMS
- See Also:
- Constant Field Values
ALIGN_LEFTS
public static final int ALIGN_LEFTS
- See Also:
- Constant Field Values
ALIGN_RIGHTS
public static final int ALIGN_RIGHTS
- See Also:
- Constant Field Values
ALIGN_CENTERS
public static final int ALIGN_CENTERS
- See Also:
- Constant Field Values
ALIGN_H_CENTERS
public static final int ALIGN_H_CENTERS
- See Also:
- Constant Field Values
ALIGN_V_CENTERS
public static final int ALIGN_V_CENTERS
- See Also:
- Constant Field Values
ALIGN_TO_GRID
public static final int ALIGN_TO_GRID
- See Also:
- Constant Field Values
direction
protected int direction
- Specification of the type of alignment requested
CmdAlign
public CmdAlign(int dir)
- Construct a new CmdAlign.
- Parameters:
dir
- The desired alignment direction, one of the constants
listed above.
wordFor
protected static java.lang.String wordFor(int d)
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