JHotDraw 7.4.1

org.jhotdraw.draw.action
Class DrawingColorChooserAction

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

public class DrawingColorChooserAction
extends EditorColorChooserAction

The DrawingColorChooserAction changes a color attribute of the Drawing object in the current view of the DrawingEditor.

The behavior for choosing the initial color of the JColorChooser matches with DrawingColorIcon.

Version:
$Id: DrawingColorChooserAction.java 604 2010-01-09 12:00:29Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.draw.action.EditorColorChooserAction
colorChooser, key
 
Fields inherited from class org.jhotdraw.draw.action.AttributeAction
attributes
 
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
DrawingColorChooserAction(DrawingEditor editor, AttributeKey<java.awt.Color> key)
          Creates a new instance.
DrawingColorChooserAction(DrawingEditor editor, AttributeKey<java.awt.Color> key, javax.swing.Icon icon)
          Creates a new instance.
DrawingColorChooserAction(DrawingEditor editor, AttributeKey<java.awt.Color> key, java.lang.String name)
          Creates a new instance.
DrawingColorChooserAction(DrawingEditor editor, AttributeKey<java.awt.Color> key, java.lang.String name, javax.swing.Icon icon)
           
DrawingColorChooserAction(DrawingEditor editor, AttributeKey<java.awt.Color> key, java.lang.String name, javax.swing.Icon icon, java.util.Map<AttributeKey,java.lang.Object> fixedAttributes)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  java.awt.Color getInitialColor()
           
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.EditorColorChooserAction
selectionChanged
 
Methods inherited from class org.jhotdraw.draw.action.AttributeAction
applyAttributesTo
 
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

DrawingColorChooserAction

public DrawingColorChooserAction(DrawingEditor editor,
                                 AttributeKey<java.awt.Color> key)
Creates a new instance.


DrawingColorChooserAction

public DrawingColorChooserAction(DrawingEditor editor,
                                 AttributeKey<java.awt.Color> key,
                                 javax.swing.Icon icon)
Creates a new instance.


DrawingColorChooserAction

public DrawingColorChooserAction(DrawingEditor editor,
                                 AttributeKey<java.awt.Color> key,
                                 java.lang.String name)
Creates a new instance.


DrawingColorChooserAction

public DrawingColorChooserAction(DrawingEditor editor,
                                 AttributeKey<java.awt.Color> key,
                                 java.lang.String name,
                                 javax.swing.Icon icon)

DrawingColorChooserAction

public DrawingColorChooserAction(DrawingEditor editor,
                                 AttributeKey<java.awt.Color> key,
                                 java.lang.String name,
                                 javax.swing.Icon icon,
                                 java.util.Map<AttributeKey,java.lang.Object> fixedAttributes)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener
Overrides:
actionPerformed in class EditorColorChooserAction

getInitialColor

protected java.awt.Color getInitialColor()
Overrides:
getInitialColor in class EditorColorChooserAction

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 AttributeAction

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