JHotDraw 7.4.1

Class DrawingColorIcon

  extended by javax.swing.ImageIcon
      extended by org.jhotdraw.draw.action.DrawingColorIcon
All Implemented Interfaces:
java.io.Serializable, javax.accessibility.Accessible, javax.swing.Icon

public class DrawingColorIcon
extends javax.swing.ImageIcon

DrawingColorIcon draws a shape with the specified color for the drawing in the current drawing view.

The behavior for choosing the drawn color matches with DrawingColorChooserAction.

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

Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.ImageIcon
Field Summary
Fields inherited from class javax.swing.ImageIcon
component, tracker
Constructor Summary
DrawingColorIcon(DrawingEditor editor, AttributeKey<java.awt.Color> key, java.awt.Image image, java.awt.Shape colorShape)
DrawingColorIcon(DrawingEditor editor, AttributeKey<java.awt.Color> key, java.net.URL imageLocation, java.awt.Shape colorShape)
          Creates a new instance.
Method Summary
 void paintIcon(java.awt.Component c, java.awt.Graphics gr, int x, int y)
Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, setDescription, setImage, setImageObserver, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public DrawingColorIcon(DrawingEditor editor,
                        AttributeKey<java.awt.Color> key,
                        java.net.URL imageLocation,
                        java.awt.Shape colorShape)
Creates a new instance.

editor - The drawing editor.
key - The key of the default attribute
imageLocation - the icon image
colorShape - The shape to be drawn with the color of the default attribute.


public DrawingColorIcon(DrawingEditor editor,
                        AttributeKey<java.awt.Color> key,
                        java.awt.Image image,
                        java.awt.Shape colorShape)
Method Detail


public void paintIcon(java.awt.Component c,
                      java.awt.Graphics gr,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon
paintIcon in class javax.swing.ImageIcon

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