Public Types | |
enum | BadgePosition |
The possibilities for badge positioning. More... | |
enum | IconState |
The states in which an icon may be rendered by the IconRenderer. More... | |
Public Member Functions | |
ImageIcon | badgeIcon (ImageIcon icon, ImageIcon badge, BadgePosition position) |
Badges the given base icon with the given badge icon, positioning the badge over the icon based on the position constant specified. | |
ImageIcon | drawTextOnIcon (ImageIcon icon, String text, Font font, Color textColor) |
Draws the given text string in the center of the icon with the given font and color. | |
ImageIcon | renderIcon (ImageIcon icon, IconState state) |
Renders the given ImageIcon transformed into the state specified, and returns the resulting icon. | |
Static Public Member Functions | |
static IconRenderer | getInstance () |
Returns the shared IconRenderer instance, creating it if necessary. | |
Static Private Attributes | |
static IconRenderer | sharedInstance = null |
The shared IconRenderer instance. |
The possibilities for badge positioning.
The states in which an icon may be rendered by the IconRenderer.
static IconRenderer edu.cmu.hcii.calo.view.IconRenderer.getInstance | ( | ) | [static] |
ImageIcon edu.cmu.hcii.calo.view.IconRenderer.badgeIcon | ( | ImageIcon | icon, | |
ImageIcon | badge, | |||
BadgePosition | position | |||
) |
Badges the given base icon with the given badge icon, positioning the badge over the icon based on the position constant specified.
Note that the badge icon should really be smaller than the base icon, or it won't look very good. In particular, the resulting badged icon will always be the same size as the base icon.
icon | the base icon | |
badge | the badge icon to apply to the base icon | |
position | the position of the badge on the icon |
ImageIcon edu.cmu.hcii.calo.view.IconRenderer.drawTextOnIcon | ( | ImageIcon | icon, | |
String | text, | |||
Font | font, | |||
Color | textColor | |||
) |
Draws the given text string in the center of the icon with the given font and color.
The size of the font is ignored, however, and the String is drawn with a small enough size so as to completely fit within the bounds of the icon.
icon | the icon to draw the text over | |
text | the text to draw | |
font | the font to draw the text in | |
textColor | the color to draw the text with |
ImageIcon edu.cmu.hcii.calo.view.IconRenderer.renderIcon | ( | ImageIcon | icon, | |
IconState | state | |||
) |
Renders the given ImageIcon transformed into the state specified, and returns the resulting icon.
See the IconState enum for a description of the state constants.
icon | the icon to render | |
state | the state to render the icon in. |
IconRenderer edu.cmu.hcii.calo.view.IconRenderer.sharedInstance = null [static, private] |
The shared IconRenderer instance.