org.jdesktop.swingx.painter
Class IconPainter
java.lang.Object
org.jdesktop.beans.AbstractBean
org.jdesktop.swingx.painter.AbstractPainter
org.jdesktop.swingx.painter.ImagePainter
org.jdesktop.swingx.painter.IconPainter
- All Implemented Interfaces:
- Painter
public class IconPainter
- extends ImagePainter
An ImagePainter subclass that provides convenience methods "setIcon" and
"getIcon" to use Icons (and ImageIcons) rather than Images directly. Because
this class uses "Icon" and because there is a "getImage" method from the
parent class, sometimes an intermediate BufferedImage will be created to
generate the image to return. This should be fairly performant, but will
of course have some overhead. To avoid this overhead, use an ImageIcon
where possible.
|
Constructor Summary |
IconPainter()
Create a new IconPainter |
IconPainter(Icon icon)
Create a new IconPainter with the specified icon. |
| Methods inherited from class org.jdesktop.swingx.painter.AbstractPainter |
getAlphaInterpolation, getAntialiasing, getClip, getColorRendering, getComposite, getDithering, getEffects, getFractionalMetrics, getInterpolation, getRendering, getRenderingHint, getRenderingHints, getResizeClip, getStrokeControl, getTextAntialiasing, isUseCache, paint, restoreState, saveState, setAlphaInterpolation, setAntialiasing, setClip, setColorRendering, setComposite, setDithering, setEffects, setEffects, setFractionalMetrics, setInterpolation, setRendering, setRenderingHint, setRenderingHints, setResizeClip, setStrokeControl, setTextAntialiasing, setUseCache |
| Methods inherited from class org.jdesktop.beans.AbstractBean |
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, clone, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
IconPainter
public IconPainter()
- Create a new IconPainter
IconPainter
public IconPainter(Icon icon)
- Create a new IconPainter with the specified icon.
- Parameters:
icon - the icon to be painted
setIcon
public void setIcon(Icon icon)
- Set the icon to use. This will fire property change notification not
only for the "icon" property, but also for the "image" property.
- Parameters:
icon - the Icon to use
getIcon
public Icon getIcon()
- Returns:
- the Icon used by this painter
getImage
public Image getImage()
- Overrides:
getImage in class ImagePainter
- Returns:
- the image used for painting the background of this panel