|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.wordpress.tipsforjava.swing.AlphaIcon
public class AlphaIcon extends Object
An Icon wrapper that paints the contained icon with a specified transparency.
Note: This class is not suitable for wrapping an ImageIcon
that holds an animated image. To show an animated ImageIcon with transparency,
use the companion class AlphaImageIcon.
| Field Summary | |
|---|---|
private float |
alpha
|
private Icon |
icon
|
| Constructor Summary | |
AlphaIcon(Icon icon, float alpha)
Creates an |
|
| Method Summary | |
|---|---|
float
|
getAlpha()
Gets this |
Icon
|
getIcon()
Gets the icon wrapped by this |
int
|
getIconHeight()
Gets the height of the bounding rectangle of this |
int
|
getIconWidth()
Gets the width of the bounding rectangle of this |
void
|
paintIcon(Component c, Graphics g, int x, int y)
Paints the wrapped icon with this |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private float alpha
private Icon icon
| Constructor Detail |
|---|
public AlphaIcon(Icon icon, float alpha)
AlphaIcon with the specified icon and opacity.
The opacity alpha should be in the range 0.0F (fully transparent)
to 1.0F (fully opaque).
icon - the Icon to wrapalpha - the opacity
| Method Detail |
|---|
public float getAlpha()
AlphaIcon's opacity
public Icon getIcon()
AlphaIcon
@Override public int getIconHeight()
AlphaIcon.
* Returns the height of the wrapped icon.
@Override public int getIconWidth()
AlphaIcon.
Returns the width of the wrapped icon.
@Override public void paintIcon(Component c, Graphics g, int x, int y)
AlphaIcon's transparency.
c - The component to which the icon is paintedg - the graphics contextx - the X coordinate of the icon's top-left cornery - the Y coordinate of the icon's top-left corner
Groovy Documentation