net.sourceforge.java.util.gui.jface.viewers
Class OverlayImageDescriptor

java.lang.Object
  extended byorg.eclipse.jface.resource.DeviceResourceDescriptor
      extended byorg.eclipse.jface.resource.ImageDescriptor
          extended byorg.eclipse.jface.resource.CompositeImageDescriptor
              extended bynet.sourceforge.java.util.gui.jface.viewers.OverlayImageDescriptor

public class OverlayImageDescriptor
extends CompositeImageDescriptor

Overlays a base Image with an adornment in shape of an overlay Image where the overlay Image can be placed on one of the four corners of the base Image.

Author:
Sebastian Machhausen

Field Summary
private  Image baseImg
           The base Image
static int BOTTOM_LEFT
           Constant to draw the overlay Image at the bottom-left corner
static int BOTTOM_RIGHT
           Constant to draw the overlay Image at the bottom-right corner
private  Point imgSize
           The size of the composite Image
private  int location
           The location of the overlay Image.
private  Image overlayImg
           The overlay Image
static int TOP_LEFT
           Constant to draw the overlay Image at the top-left corner
static int TOP_RIGHT
           Constant to draw the overlay Image at the top-right corner
 
Fields inherited from class org.eclipse.jface.resource.CompositeImageDescriptor
 
Fields inherited from class org.eclipse.jface.resource.ImageDescriptor
DEFAULT_IMAGE_DATA
 
Constructor Summary
OverlayImageDescriptor(Image baseImg, Image overlayImg, int location)
           Creates a new OverlayImageDescriptor instance.
 
Method Summary
protected  void drawCompositeImage(int width, int height)
           Draws the composite Image.
 Image getImage()
           Get the Image formed by overlaying different Images on the base Image.
protected  Point getSize()
           Gets the size of the composite Image.
 
Methods inherited from class org.eclipse.jface.resource.CompositeImageDescriptor
drawImage, getImageData
 
Methods inherited from class org.eclipse.jface.resource.ImageDescriptor
createFromFile, createFromImage, createFromImage, createFromImageData, createFromURL, createImage, createImage, createImage, createImage, createResource, createWithFlags, destroyResource, getMissingImageDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP_LEFT

public static final int TOP_LEFT

Constant to draw the overlay Image at the top-left corner

See Also:
Constant Field Values

TOP_RIGHT

public static final int TOP_RIGHT

Constant to draw the overlay Image at the top-right corner

See Also:
Constant Field Values

BOTTOM_LEFT

public static final int BOTTOM_LEFT

Constant to draw the overlay Image at the bottom-left corner

See Also:
Constant Field Values

BOTTOM_RIGHT

public static final int BOTTOM_RIGHT

Constant to draw the overlay Image at the bottom-right corner

See Also:
Constant Field Values

baseImg

private Image baseImg

The base Image


overlayImg

private Image overlayImg

The overlay Image


imgSize

private Point imgSize

The size of the composite Image


location

private int location

The location of the overlay Image.
Use one of the predefined locations:

Constructor Detail

OverlayImageDescriptor

public OverlayImageDescriptor(Image baseImg,
                              Image overlayImg,
                              int location)

Creates a new OverlayImageDescriptor instance.

Parameters:
baseImg - the base Image
overlayImg - the overlay Image
location - the location of the overlay Image.
Use one of the predefined locations:
Method Detail

drawCompositeImage

protected void drawCompositeImage(int width,
                                  int height)

Draws the composite Image.

Parameters:
width - the width
height - the height
See Also:
CompositeImageDescriptor.drawCompositeImage(int, int)

getSize

protected Point getSize()

Gets the size of the composite Image.

Returns:
the size of the composite Image
See Also:
CompositeImageDescriptor.getSize()

getImage

public Image getImage()

Get the Image formed by overlaying different Images on the base Image.

Returns:
the composite Image