org.jhotdraw.draw.action
Class AlignAction
java.lang.Object
javax.swing.AbstractAction
org.jhotdraw.draw.action.AbstractSelectedAction
org.jhotdraw.draw.action.AlignAction
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, Disposable
- Direct Known Subclasses:
- AlignAction.East, AlignAction.Horizontal, AlignAction.North, AlignAction.South, AlignAction.Vertical, AlignAction.West
public abstract class AlignAction
- extends AbstractSelectedAction
Aligns the selected figures.
XXX - Fire edit events
- Version:
- $Id: AlignAction.java 647 2010-01-24 22:52:59Z rawcoder $
- Author:
- Werner Randelshofer
- 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, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
protected abstract void |
alignFigures(java.util.Collection selectedFigures,
java.awt.geom.Rectangle2D.Double selectionBounds)
|
protected java.awt.geom.Rectangle2D.Double |
getSelectionBounds()
Returns the bounds of the selected figures. |
void |
updateEnabledState()
Updates the enabled state of this action to reflect the enabled state
of the active DrawingView . |
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 |
AlignAction
public AlignAction(DrawingEditor editor)
- Creates a new instance.
updateEnabledState
public void updateEnabledState()
- Description copied from class:
AbstractSelectedAction
- Updates the enabled state of this action to reflect the enabled state
of the active
DrawingView
. If no drawing view is active, this
action is disabled.
- Overrides:
updateEnabledState
in class AbstractSelectedAction
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
alignFigures
protected abstract void alignFigures(java.util.Collection selectedFigures,
java.awt.geom.Rectangle2D.Double selectionBounds)
getSelectionBounds
protected java.awt.geom.Rectangle2D.Double getSelectionBounds()
- Returns the bounds of the selected figures.