dsto.dfc.swt.icons
Class ImageResourceIcon
java.lang.Object
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
ImageResourceIcon
public ImageResourceIcon(String resourceName)
- Create a new instance.
- Parameters:
resourceName
- The image's resource path.
- Throws:
IllegalArgumentException
- if Images.findResource () cannot resolve.
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