dsto.dfc.swt.icons
Class DynamicIcon

java.lang.Object
  extended by dsto.dfc.swt.icons.DynamicIcon
All Implemented Interfaces:
Icon
Direct Known Subclasses:
ColourIcon

public abstract class DynamicIcon
extends Object
implements Icon

Base class for icons that draw themselves dynamically.

Author:
Matthew Phillips

Constructor Summary
DynamicIcon()
           
 
Method Summary
 org.eclipse.swt.graphics.Image createImage(org.eclipse.swt.graphics.Device device)
          Creates a new image and calls paintIcon(GC, int, int) to fill it in.
abstract  int getIconHeight()
           
abstract  int getIconWidth()
           
 org.eclipse.swt.graphics.ImageData getImageData()
           
abstract  void paintIcon(org.eclipse.swt.graphics.GC gc, int x, int y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicIcon

public DynamicIcon()
Method Detail

createImage

public org.eclipse.swt.graphics.Image createImage(org.eclipse.swt.graphics.Device device)
Creates a new image and calls paintIcon(GC, int, int) to fill it in. Does not take transparency into account. TODO support image masks.

Specified by:
createImage in interface Icon

getImageData

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

getIconHeight

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

getIconWidth

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

paintIcon

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


Copyright © 2008 Commonwealth of Australia