Package org.opensourcephysics.display
Class ColorIcon
java.lang.Object
org.opensourcephysics.display.ColorIcon
- All Implemented Interfaces:
Icon
This Icon fills or outlines itself with the color specified in its constructor.
- Author:
- Douglas Brown
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the icon height.intGets the icon width.voidPaints the icon.voidSets the color.
-
Constructor Details
-
ColorIcon
Constructs a ColorIcon.- Parameters:
color- color of the iconwidth- width of the iconheight- height of the icon
-
ColorIcon
Constructs an outlined ColorIcon.- Parameters:
fillColor- fill color of the iconoutlineColor- outline color of the iconwidth- width of the iconheight- height of the icon
-
-
Method Details
-
setColor
Sets the color.- Parameters:
color- the desired color
-
getIconWidth
public int getIconWidth()Gets the icon width.- Specified by:
getIconWidthin interfaceIcon- Returns:
- the icon width
-
getIconHeight
public int getIconHeight()Gets the icon height.- Specified by:
getIconHeightin interfaceIcon- Returns:
- the icon height
-
paintIcon
Paints the icon.
-