org.openbp.common.icon
Class OverlayIcon
java.lang.Object
javax.swing.ImageIcon
org.openbp.common.icon.MultiImageIcon
org.openbp.common.icon.OverlayIcon
- All Implemented Interfaces:
- java.io.Serializable, javax.accessibility.Accessible, javax.swing.Icon, FlexibleSize, MultiIcon
public class OverlayIcon
- extends MultiImageIcon
Icon that can be placed over an existing icon. This class is usally used
in accordance with the flyweight pattern, i.e. one instance is used for
multiple icons.
- Author:
- Stephan Moritz
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from class javax.swing.ImageIcon |
javax.swing.ImageIcon.AccessibleImageIcon |
| Fields inherited from class javax.swing.ImageIcon |
component, tracker |
|
Method Summary |
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paints first the background and the overlay on top of each other. |
OverlayIcon |
setBackground(javax.swing.Icon background)
Sets the background. |
| Methods inherited from class javax.swing.ImageIcon |
getAccessibleContext, getDescription, getImageLoadStatus, getImageObserver, loadImage, setDescription, setImage, setImageObserver, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OverlayIcon
public OverlayIcon(MultiImageIcon master)
- Creates a new OverlayIcon with master out of master.
- Parameters:
master - The icon that should be the master of this overlay icon
setBackground
public OverlayIcon setBackground(javax.swing.Icon background)
- Sets the background.
- Parameters:
background - The background to set
- Returns:
- The changed OverlayIcon
paintIcon
public void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
- Paints first the background and the overlay on top of each other.
- Specified by:
paintIcon in interface javax.swing.Icon- Overrides:
paintIcon in class MultiImageIcon
- Parameters:
c - The component to paint ong - The graphics object to be used for paintingx - The x coordinate where the icon should be paintedy - The y coordinate where the icon should be painted- See Also:
Icon.paintIcon(Component, Graphics, int, int)
Copyright © 2011. All Rights Reserved.