javax.swing.plaf.metal
Class MetalIconFactory.FileIcon16

java.lang.Object
  extended by javax.swing.plaf.metal.MetalIconFactory.FileIcon16
All Implemented Interfaces:
Serializable, Icon
Direct Known Subclasses:
MetalIconFactory.TreeLeafIcon
Enclosing class:
MetalIconFactory

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).

See Also:
Serialized Form

Constructor Summary
MetalIconFactory.FileIcon16()
           
 
Method Summary
 int getAdditionalHeight()
          Returns the additional height for the icon.
 int getIconHeight()
          Returns the height of the icon, in pixels.
 int getIconWidth()
          Returns the width of the icon, in pixels.
 int getShift()
          Returns the vertical shift, in pixels, applied when painting the icon.
 void paintIcon(Component c, Graphics g, int x, int y)
          Paints the icon at the location (x, y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetalIconFactory.FileIcon16

public MetalIconFactory.FileIcon16()
Method Detail

getIconWidth

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

Specified by:
getIconWidth in interface Icon
Returns:
The width of the icon.

getIconHeight

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

Specified by:
getIconHeight in interface Icon
Returns:
The height of the icon.

paintIcon

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

Specified by:
paintIcon in interface Icon
Parameters:
c - the component.
g - the graphics context.
x - the x coordinate.
y - the y coordinate.

getAdditionalHeight

public int getAdditionalHeight()
Returns the additional height for the icon. The 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).

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 MetalIconFactory.TreeLeafIcon).

Returns:
The shift.