public final class TranslucentIcon
extends java.lang.Object
implements javax.swing.Icon
Icon that paints another icon with alpha so that it is
translucent (partially transparent).| Constructor and Description |
|---|
TranslucentIcon(javax.swing.Icon baseIcon)
Creates a translucent icon that paints the specified base icon.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getAlpha()
Returns the alpha transparency of this icon.
|
int |
getIconHeight() |
int |
getIconWidth() |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
void |
setAlpha(float alpha)
Sets the alpha transparency to paint with.
|
public TranslucentIcon(javax.swing.Icon baseIcon)
baseIcon - a base icon to paint. Must not be null.public void setAlpha(float alpha)
alpha - the alpha transparency. Must be between 0.0 and 1.0.public float getAlpha()
public void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
paintIcon in interface javax.swing.Iconpublic int getIconWidth()
getIconWidth in interface javax.swing.Iconpublic int getIconHeight()
getIconHeight in interface javax.swing.Icon