org.peace_tools.views.overlap
Class ClusterListCellRenderer.CustomIcon

java.lang.Object
  extended by org.peace_tools.views.overlap.ClusterListCellRenderer.CustomIcon
All Implemented Interfaces:
javax.swing.Icon
Enclosing class:
ClusterListCellRenderer

private class ClusterListCellRenderer.CustomIcon
extends java.lang.Object
implements javax.swing.Icon

A simple, custom icon class. This icon class provides a custom Icon implementation to render a simple square box, filled with a specific color. The component is sufficiently simple and has a very small memory foot print. It paints the icon each time the paintIcon(Component, Graphics, int, int) method is invoked.


Field Summary
private  java.awt.Color color
          The color with which the square area of the icon is to be painted.
 
Constructor Summary
ClusterListCellRenderer.CustomIcon()
          Default constructor.
 
Method Summary
 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 color to be used to render the icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

color

private java.awt.Color color
The color with which the square area of the icon is to be painted.

Constructor Detail

ClusterListCellRenderer.CustomIcon

public ClusterListCellRenderer.CustomIcon()
Default constructor. The constructor sets the default color to light gray.

Method Detail

setColor

public void setColor(java.awt.Color color)
Set the color to be used to render the icon.

Parameters:
color - The color to be used to fill the square area of the icon.

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