javax.swing.plaf.metal

Class MetalIconFactory.FileIcon16

public static class MetalIconFactory.FileIcon16 extends Object implements Icon, Serializable

An icon representing a file (drawn as a piece of paper with the top-right corner turned down).
Method Summary
intgetAdditionalHeight()
Returns the additional height for the icon.
intgetIconHeight()
Returns the height of the icon, in pixels.
intgetIconWidth()
Returns the width of the icon, in pixels.
intgetShift()
Returns the vertical shift, in pixels, applied when painting the icon.
voidpaintIcon(Component c, Graphics g, int x, int y)
Paints the icon at the location (x, y).

Method Detail

getAdditionalHeight

public int getAdditionalHeight()
Returns the additional height for the icon. The {@link #getIconHeight()} method adds this value to the icon height it returns. Subclasses can override this method to adjust the icon height.

Returns: The additional height (0 unless overridden).

getIconHeight

public int getIconHeight()
Returns the height of the icon, in pixels. The height returned is 16 plus the value returned by {@link #getAdditionalHeight()}.

Returns: The height of the icon.

getIconWidth

public int getIconWidth()
Returns the width of the icon, in pixels.

Returns: The width of the icon.

getShift

public int getShift()
Returns the vertical shift, in pixels, applied when painting the icon. The default value is zero, but subclasses may override this (for example, see {@link TreeLeafIcon}).

Returns: The shift.

paintIcon

public void paintIcon(Component c, Graphics g, int x, int y)
Paints the icon at the location (x, y).

Parameters: c the component. g the graphics context. x the x coordinate. y the y coordinate.