org.jhotdraw.draw.action
Class SelectionColorChooserHandler

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.jhotdraw.draw.action.AbstractSelectedAction
          extended by org.jhotdraw.draw.action.SelectionColorChooserHandler
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action, javax.swing.event.ChangeListener, Disposable

public class SelectionColorChooserHandler
extends AbstractSelectedAction
implements javax.swing.event.ChangeListener

SelectionColorChooserHandler.

Author:
Werner Randelshofer  @version $Id$
See Also:
Serialized Form

Field Summary
protected  javax.swing.JColorChooser colorChooser
           
protected  int isUpdating
           
protected  AttributeKey<java.awt.Color> key
           
protected  javax.swing.JPopupMenu popupMenu
           
 
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
SelectionColorChooserHandler(DrawingEditor editor, AttributeKey<java.awt.Color> key, javax.swing.JColorChooser colorChooser, javax.swing.JPopupMenu popupMenu)
          Creates a new instance.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
           
protected  void applySelectedColorToFigures()
           
 void stateChanged(javax.swing.event.ChangeEvent e)
           
protected  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
 

Field Detail

key

protected AttributeKey<java.awt.Color> key

colorChooser

protected javax.swing.JColorChooser colorChooser

popupMenu

protected javax.swing.JPopupMenu popupMenu

isUpdating

protected int isUpdating
Constructor Detail

SelectionColorChooserHandler

public SelectionColorChooserHandler(DrawingEditor editor,
                                    AttributeKey<java.awt.Color> key,
                                    javax.swing.JColorChooser colorChooser,
                                    javax.swing.JPopupMenu popupMenu)
Creates a new instance.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent evt)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

applySelectedColorToFigures

protected void applySelectedColorToFigures()

updateEnabledState

protected 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

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Specified by:
stateChanged in interface javax.swing.event.ChangeListener