| java.lang.Object com.jgoodies.validation.extras.CompoundIcon
CompoundIcon | final public class CompoundIcon implements Icon(Code) | | An Icon implementation that paints two icons
as compound or overlaid icon using a specified alignment.
Note: This class is not yet part of the binary Validation
library; it comes with the Validation distributions as an extra.
The API is work in progress and may change without notice;
this class may even be completely removed from future distributions.
If you want to use this class, you may consider copying it into
your code base.
author: Karsten Lentzsch version: $Revision: 1.11 $ See Also: javax.swing.ImageIcon |
Inner Class :public enum Anchor | |
Constructor Summary | |
public | CompoundIcon(Icon backgroundIcon, Icon foregroundIcon) Constructs a compound icon for the given foreground and background icons,
using a default anchor. | public | CompoundIcon(Icon backgroundIcon, Icon foregroundIcon, Anchor anchor) Constructs a compound icon for the given foreground and background icons,
using the specified anchor. |
Method Summary | |
public int | getIconHeight() Returns this icon's height, which is the maximum of
the heights of the background and foreground icons. | public int | getIconWidth() Returns this icon's width, which is the maximum of
the widths of the background and foreground icons. | public void | paintIcon(Component c, Graphics g, int x, int y) Draws this icon at the specified location. |
CompoundIcon | public CompoundIcon(Icon backgroundIcon, Icon foregroundIcon)(Code) | | Constructs a compound icon for the given foreground and background icons,
using a default anchor.
Parameters: backgroundIcon - the icon in the centered background Parameters: foregroundIcon - the icon that overlays the background icon |
CompoundIcon | public CompoundIcon(Icon backgroundIcon, Icon foregroundIcon, Anchor anchor)(Code) | | Constructs a compound icon for the given foreground and background icons,
using the specified anchor.
Parameters: backgroundIcon - the icon in the centered background Parameters: foregroundIcon - the icon that overlays the background icon Parameters: anchor - the position of the foreground icon relativeto the background icon |
getIconHeight | public int getIconHeight()(Code) | | Returns this icon's height, which is the maximum of
the heights of the background and foreground icons.
an int specifying the fixed height of this icon. |
getIconWidth | public int getIconWidth()(Code) | | Returns this icon's width, which is the maximum of
the widths of the background and foreground icons.
an int specifying the fixed width of this icon. |
paintIcon | public void paintIcon(Component c, Graphics g, int x, int y)(Code) | | Draws this icon at the specified location. First paints
the background icon at the specified location, then paints
the foreground icon using the offsets computed in #setAnchor.
|
|
|