org.geotools.swing.styling
Class JColorIcon

java.lang.Object
  extended by org.geotools.swing.styling.JColorIcon
All Implemented Interfaces:
javax.swing.Icon

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

An Icon to display a color. Used by JSimpleStyleDialog.

Since:
2.6
Version:
$Id: JColorIcon.java 33920 2009-09-18 08:56:40Z mbedward $
Author:
Michael Bedward

Constructor Summary
JColorIcon(int width, int height, java.awt.Color color)
          Construtor.
 
Method Summary
 int getIconHeight()
          Get the icon's height
 int getIconWidth()
          Get the icon's width
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Paint the icon using the current color.
 void setColor(java.awt.Color color)
          Set the color
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JColorIcon

public JColorIcon(int width,
                  int height,
                  java.awt.Color color)
Construtor.

Parameters:
width - icon width
height - icon height
color - initial color
Method Detail

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Paint the icon using the current color. This method is invoked by the System.

Specified by:
paintIcon in interface javax.swing.Icon
Parameters:
c - arg presently ignored
g - graphics object
x - x position
y - y position

getIconWidth

public int getIconWidth()
Get the icon's width

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
width in pixels

getIconHeight

public int getIconHeight()
Get the icon's height

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
height in pixels

setColor

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

Parameters:
color - new color


Copyright © 1996-2010 Geotools. All Rights Reserved.