org.peace_tools.views.overlap
Class ClusterListCellRenderer.CustomIcon
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
color
private java.awt.Color color
- The color with which the square area of the icon is to be
painted.
ClusterListCellRenderer.CustomIcon
public ClusterListCellRenderer.CustomIcon()
- Default constructor.
The constructor sets the default color to light gray.
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