de.grogra.icon
Class IconAdapter

java.lang.Object
  extended by java.awt.geom.Dimension2D
      extended by java.awt.Dimension
          extended by de.grogra.icon.IconAdapter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, javax.swing.Icon

public final class IconAdapter
extends java.awt.Dimension
implements javax.swing.Icon

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.awt.Dimension
height, width
 
Constructor Summary
IconAdapter(IconSource source, Icon icon, int width, int height, boolean forceSize, int state)
           
 
Method Summary
static IconAdapter create(IconSource source, java.awt.Dimension size)
           
static IconAdapter create(IconSource source, java.awt.Dimension size, boolean forceSize)
           
static IconAdapter create(IconSource source, java.awt.Dimension size, boolean forceSize, int state)
           
 Icon getIcon()
           
 int getIconHeight()
           
 IconSource getIconSource()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void set(Icon icon, int width, int height, int state)
           
 IconAdapter toState(int state)
           
 
Methods inherited from class java.awt.Dimension
equals, getHeight, getSize, getWidth, hashCode, setSize, setSize, setSize, toString
 
Methods inherited from class java.awt.geom.Dimension2D
clone, setSize
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IconAdapter

public IconAdapter(IconSource source,
                   Icon icon,
                   int width,
                   int height,
                   boolean forceSize,
                   int state)
Method Detail

create

public static IconAdapter create(IconSource source,
                                 java.awt.Dimension size)

create

public static IconAdapter create(IconSource source,
                                 java.awt.Dimension size,
                                 boolean forceSize)

create

public static IconAdapter create(IconSource source,
                                 java.awt.Dimension size,
                                 boolean forceSize,
                                 int state)

getIcon

public Icon getIcon()

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getIconSource

public IconSource getIconSource()

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon

set

public void set(Icon icon,
                int width,
                int height,
                int state)

toState

public IconAdapter toState(int state)