JHotDraw 7.5.1

org.jhotdraw.draw.action
Class AlignAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jhotdraw.draw.action.AbstractSelectedAction
          extended by 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

Nested Class Summary
static class AlignAction.East
           
static class AlignAction.Horizontal
           
static class AlignAction.North
           
static class AlignAction.South
           
static class AlignAction.Vertical
           
static class AlignAction.West
           
 
Field Summary
 
Fields inherited from class org.jhotdraw.draw.action.AbstractSelectedAction
labels
 
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
 
Constructor Summary
AlignAction(DrawingEditor editor)
          Creates a new instance.
 
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 org.jhotdraw.draw.action.AbstractSelectedAction
dispose, fireUndoableEditHappened, getDrawing, getEditor, getView, isUpdatEnabledState, setEditor, setUpdateEnabledState
 
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
 

Constructor Detail

AlignAction

public AlignAction(DrawingEditor editor)
Creates a new instance.

Method Detail

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.


Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.