org.jhotdraw.draw.action
Class AbstractSelectedAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jhotdraw.draw.action.AbstractSelectedAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
Direct Known Subclasses:
AlignAction, ApplyAttributesAction, AttributeAction, BringToFrontAction, CombineAction, DefaultAttributeAction, FontChooserHandler, GroupAction, IncreaseHandleDetailLevelAction, MoveAction, MoveConstrainedAction, PickAttributesAction, SelectSameAction, SendToBackAction

public abstract class AbstractSelectedAction
extends javax.swing.AbstractAction

Abstract super class for actions which act on the selected figures of a drawing editor. If no figures are selected, the action is disabled.

Version:
3.1.2 2008-06-08 Method setEditor did not register the EventHandler to the active view of the editor.
3.1.1. 2006-07-09 Fixed enabled state.
3.1 2006-03-15 Support for enabled state of view added.
3.0 2006-02-24 Changed to support multiple views.
2.0 2006-02-14 Updated to work with multiple views.
1.0 2003-12-01 Created.
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
private  class AbstractSelectedAction.EventHandler
           
 
Field Summary
private  DrawingEditor editor
           
private  AbstractSelectedAction.EventHandler eventHandler
           
protected  ResourceBundleUtil 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
AbstractSelectedAction(DrawingEditor editor)
          Creates an action which acts on the selected figures on the current view of the specified editor.
 
Method Summary
 void dispose()
           
protected  void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)
           
protected  Drawing getDrawing()
           
 DrawingEditor getEditor()
           
protected  DrawingView getView()
           
 void setEditor(DrawingEditor editor)
           
protected  void updateEnabledState()
           
 
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
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

editor

private DrawingEditor editor

labels

protected ResourceBundleUtil labels

eventHandler

private AbstractSelectedAction.EventHandler eventHandler
Constructor Detail

AbstractSelectedAction

public AbstractSelectedAction(DrawingEditor editor)
Creates an action which acts on the selected figures on the current view of the specified editor.

Method Detail

updateEnabledState

protected void updateEnabledState()

dispose

public void dispose()

setEditor

public void setEditor(DrawingEditor editor)

getEditor

public DrawingEditor getEditor()

getView

protected DrawingView getView()

getDrawing

protected Drawing getDrawing()

fireUndoableEditHappened

protected void fireUndoableEditHappened(javax.swing.undo.UndoableEdit edit)