dsto.dfc.swt.icons
Class ImageResourceIcon

java.lang.Object
  extended by dsto.dfc.swt.icons.ImageResourceIcon
All Implemented Interfaces:
Icon

public class ImageResourceIcon
extends Object
implements Icon

An icon that paints an image retrieved from a local resource (.gif, .png, etc).

Author:
mpp

Constructor Summary
ImageResourceIcon(String resourceName)
          Create a new instance.
 
Method Summary
 org.eclipse.swt.graphics.Image createImage()
           
 org.eclipse.swt.graphics.Image createImage(org.eclipse.swt.graphics.Device device)
           
 boolean equals(ImageResourceIcon icon)
           
 boolean equals(Object obj)
           
 int getIconHeight()
           
 int getIconWidth()
           
 org.eclipse.swt.graphics.Image getImage()
          Shortcut to get a cached version of the icon image.
 org.eclipse.swt.graphics.ImageData getImageData()
           
 int hashCode()
           
 void paintIcon(org.eclipse.swt.graphics.GC gc, int x, int y)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ImageResourceIcon

public ImageResourceIcon(String resourceName)
Create a new instance.

Parameters:
resourceName - The image's resource path.
Throws:
IllegalArgumentException - if Images.findResource () cannot resolve.
Method Detail

getImage

public org.eclipse.swt.graphics.Image getImage()
Shortcut to get a cached version of the icon image. The image is placed in the default IconCache.


createImage

public org.eclipse.swt.graphics.Image createImage()

createImage

public org.eclipse.swt.graphics.Image createImage(org.eclipse.swt.graphics.Device device)
Specified by:
createImage in interface Icon

getImageData

public org.eclipse.swt.graphics.ImageData getImageData()
Specified by:
getImageData in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

paintIcon

public void paintIcon(org.eclipse.swt.graphics.GC gc,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

equals

public boolean equals(ImageResourceIcon icon)

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2008 Commonwealth of Australia