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 TypeMethodDescriptionint
Gets the icon height.int
Gets the icon width.void
Paints the icon.void
Sets 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:
getIconWidth
in interfaceIcon
- Returns:
- the icon width
-
getIconHeight
public int getIconHeight()Gets the icon height.- Specified by:
getIconHeight
in interfaceIcon
- Returns:
- the icon height
-
paintIcon
Paints the icon.
-