net.yura.mobile.gui
Class Icon

java.lang.Object
  extended by net.yura.mobile.gui.Icon
Direct Known Subclasses:
AndroidIcon, FadeIcon, MetalIcon, NimbusIcon

public class Icon
extends Object

Author:
Yura Mamyrin
See Also:
Icon, ImageIcon

Field Summary
protected  int height
           
protected  int px
           
protected  int py
           
protected  int width
           
 
Constructor Summary
Icon()
           
Icon(javax.microedition.lcdui.Image img)
           
Icon(String imageName)
          this constructor does not throw an exception on Image that is not found, instead it creates a Icon with 0 height and width, (in Swing height and width are -1)
 
Method Summary
 int getIconHeight()
           
 int getIconWidth()
           
 javax.microedition.lcdui.Image getImage()
          This method will only work if this Icon is actually a ImageIcon otherwise it will return null
 Icon getSubimage(int x, int y, int w, int h)
           
 void paintIcon(Component c, Graphics2D g, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

height

protected int height

px

protected int px

py

protected int py

width

protected int width
Constructor Detail

Icon

public Icon()

Icon

public Icon(javax.microedition.lcdui.Image img)
See Also:
ImageIcon.ImageIcon

Icon

public Icon(String imageName)
this constructor does not throw an exception on Image that is not found, instead it creates a Icon with 0 height and width, (in Swing height and width are -1)

See Also:
ImageIcon.ImageIcon, Class.getResourceAsStream
Method Detail

getIconHeight

public int getIconHeight()
See Also:
Icon.getIconHeight

getIconWidth

public int getIconWidth()
See Also:
Icon.getIconWidth

getImage

public javax.microedition.lcdui.Image getImage()
This method will only work if this Icon is actually a ImageIcon otherwise it will return null

See Also:
ImageIcon.getImage

getSubimage

public Icon getSubimage(int x,
                        int y,
                        int w,
                        int h)
See Also:
BufferedImage.getSubimage(int, int, int, int)

paintIcon

public void paintIcon(Component c,
                      Graphics2D g,
                      int x,
                      int y)
See Also:
Icon.paintIcon