JHotDraw 7.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
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:
2.1 2008-02-27 Only align figures which are transformable.
2.0 2006-01-15 Changed to support double precision coordinates.
1.0 17. March 2004 Created.
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, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, 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()
           
 
Methods inherited from class org.jhotdraw.draw.action.AbstractSelectedAction
dispose, fireUndoableEditHappened, getDrawing, getEditor, getView, setEditor
 
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()
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-2007 (c) JHotDraw.org.
Some rights reserved.