edu.rice.cs.util.swing
Class CenteredIcon
java.lang.Object
edu.rice.cs.util.swing.CenteredIcon
- All Implemented Interfaces:
- Icon
public class CenteredIcon
- extends Object
- implements Icon
This icon takes the given icon and centers it into a canvas of the given width and height. This is like a canvas
resize for Icons. If the new size is smaller than the icon's size, then the edges of the given icon are clipped.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CenteredIcon
public CenteredIcon(Icon base,
int width,
int height)
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight
in interface Icon
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth
in interface Icon
paintIcon
public void paintIcon(Component c,
Graphics g,
int x,
int y)
- Specified by:
paintIcon
in interface Icon
getBaseIcon
public Icon getBaseIcon()