com.ucware.icontools
Class IcoIcon

java.lang.Object
  extended by com.ucware.icontools.IcoIcon
All Implemented Interfaces:
java.io.Serializable, javax.swing.Icon

public class IcoIcon
extends java.lang.Object
implements javax.swing.Icon, java.io.Serializable

An implementation of the Icon interface that paints Icons from the ICO file format. The ICO file format is an image file format used for icons in Microsoft Windows.

See Also:
Serialized Form

Constructor Summary
IcoIcon(com.ucware.coff.rticon.IcoEntry icoEntry)
           
 
Method Summary
 int getBiBitCount()
          Specifies the number of bits-per-pixel.
 com.ucware.coff.rticon.IcoEntry getIcoEntry()
          Returns the IcoEntry for this icon.
 int getIconHeight()
          Returns the icon's height.
 int getIconWidth()
          Returns the icon's width.
 java.awt.Image getImage()
          Returns the Image for this icon.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Draw the icon at the specified location.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IcoIcon

public IcoIcon(com.ucware.coff.rticon.IcoEntry icoEntry)
Method Detail

getIconHeight

public int getIconHeight()
Returns the icon's height.

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
an int specifying the fixed height of the icon.

getIconWidth

public int getIconWidth()
Returns the icon's width.

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
an int specifying the fixed width of the icon.

getBiBitCount

public int getBiBitCount()
Specifies the number of bits-per-pixel. The biBitCount determines the number of bits that define each pixel and the maximum number of colors in the bitmap. This member must be one of the following values: 0, 1, 2, 4, 8, 16, 24, 32;

Returns:
an int specifying the number of bits-per-pixel.

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.

Specified by:
paintIcon in interface javax.swing.Icon

getIcoEntry

public com.ucware.coff.rticon.IcoEntry getIcoEntry()
Returns the IcoEntry for this icon.

Returns:
IcoEntry

getImage

public java.awt.Image getImage()
Returns the Image for this icon.

Returns:
Image