kawigi.widget
Class ChipIcon

java.lang.Object
  extended by kawigi.widget.ChipIcon
All Implemented Interfaces:
javax.swing.Icon

public class ChipIcon
extends java.lang.Object
implements javax.swing.Icon

Represents an icon with a "color chip" which represents the current selected color. This is similar to color swatches used in some non-Java applications where the icon has a small rectangle indicating the current color on top of the regular icon.


Constructor Summary
ChipIcon(javax.swing.Icon icon, ColorSwatchDropdown colorPicker)
          Constructs a new ChipIcon which draws a color chip on top of the given Icon in the color selected by the given ColorSwatchDropdown.
 
Method Summary
 int getIconHeight()
          Returns the height of this icon.
 int getIconWidth()
          Returns the width of this icon.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Draws this icon at the given location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChipIcon

public ChipIcon(javax.swing.Icon icon,
                ColorSwatchDropdown colorPicker)
Constructs a new ChipIcon which draws a color chip on top of the given Icon in the color selected by the given ColorSwatchDropdown.

Method Detail

getIconHeight

public int getIconHeight()
Returns the height of this icon.

Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Returns the width of this icon.

Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Draws this icon at the given location.

Specified by:
paintIcon in interface javax.swing.Icon