Package noaa.coastwatch.gui.visual
Class ColorSwatch
java.lang.Object
noaa.coastwatch.gui.visual.ColorSwatch
- All Implemented Interfaces:
Icon
The
ColorSwatch
class is an icon that shows a
rectangle of a given color.- Since:
- 3.1.7
- Author:
- Peter Hollemans
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the icon height.int
Gets the icon width.void
Paints the icon to the specified graphics context.void
Sets the swatch color.
-
Constructor Details
-
ColorSwatch
Create a new color swatch.- Parameters:
color
- the color to display.width
- the icon width.height
- the icon height.
-
-
Method Details
-
getIconWidth
public int getIconWidth()Gets the icon width.- Specified by:
getIconWidth
in interfaceIcon
-
getIconHeight
public int getIconHeight()Gets the icon height.- Specified by:
getIconHeight
in interfaceIcon
-
paintIcon
Paints the icon to the specified graphics context. -
setColor
Sets the swatch color.
-