templates.library
Class AddTemplateDialog.ColorIcon

java.lang.Object
  extended by templates.library.AddTemplateDialog.ColorIcon
All Implemented Interfaces:
javax.swing.Icon
Enclosing class:
AddTemplateDialog

protected static class AddTemplateDialog.ColorIcon
extends java.lang.Object
implements javax.swing.Icon

Icon which displays a square with a selected background color.

Author:
Lenko Grigorov

Field Summary
protected static int SIZE
          The length of the side of the icon (square).
 
Constructor Summary
protected AddTemplateDialog.ColorIcon()
           
 
Method Summary
 java.awt.Color getColor()
          Retrieve the background color of the icon.
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void setColor(java.awt.Color color)
          Set the background color of the icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIZE

protected static final int SIZE
The length of the side of the icon (square).

See Also:
Constant Field Values
Constructor Detail

AddTemplateDialog.ColorIcon

protected AddTemplateDialog.ColorIcon()
Method Detail

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

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

setColor

public void setColor(java.awt.Color color)
Set the background color of the icon.

Parameters:
color - the new background color of the icon

getColor

public java.awt.Color getColor()
Retrieve the background color of the icon.

Returns:
the background color of the icon