- java.lang.Object
-
- util.ui.FixedSizeIcon
-
- All Implemented Interfaces:
javax.swing.Icon
public class FixedSizeIcon extends java.lang.Object implements javax.swing.Icon
An icon having a fixed size. This icon wrappes a nested icon. If the nested Icon is smaller than the defined size, it will be shown in the center of this icon (The nested icon will get a transparent border).- Author:
- Til Schneider, www.murfman.de
- See Also:
Plugin.getButtonAction()
-
-
Constructor Summary
Constructors Constructor Description FixedSizeIcon(int width, int height, javax.swing.Icon nestedIcon)
Creates a new instance of FixedSizeIcon.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIconHeight()
Gets the icon's height.int
getIconWidth()
Gets the icon's width.void
paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
Paints the icon.
-
-
-
Method Detail
-
getIconWidth
public int getIconWidth()
Gets the icon's width.- Specified by:
getIconWidth
in interfacejavax.swing.Icon
- Returns:
- the icon's width
-
getIconHeight
public int getIconHeight()
Gets the icon's height.- Specified by:
getIconHeight
in interfacejavax.swing.Icon
- Returns:
- the icon's height
-
paintIcon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
Paints the icon.- Specified by:
paintIcon
in interfacejavax.swing.Icon
- Parameters:
c
- May be used to get properties useful for painting, e.g. the foreground or background color.g
- The graphics context to paint to.x
- The x position where to paint the icony
- The y position where to paint the icon
-
-