public class DecorationOverlayIcon extends CompositeImageDescriptor
DecorationOverlayIcon
is an image descriptor that can be used
to overlay decoration images on to the 4 corner quadrants of a base image.
The four quadrants are IDecoration.TOP_LEFT
, IDecoration.TOP_RIGHT
,
IDecoration.BOTTOM_LEFT
and IDecoration.BOTTOM_RIGHT
. Additionally,
the overlay can be used to provide an underlay corresponding to IDecoration.UNDERLAY
,
and to replace the base image with IDecoration.REPLACE
(if supported by the context).IDecoration
CompositeImageDescriptor.CachedImageDataProvider
DEFAULT_IMAGE_DATA
Constructor and Description |
---|
DecorationOverlayIcon(ImageDescriptor baseImageDescriptor,
ImageDescriptor overlayImageDescriptor,
int quadrant)
Create a decoration overlay icon that will place the given overlay icon
in the given quadrant of the base image descriptor.
|
DecorationOverlayIcon(Image baseImage,
ImageDescriptor[] overlaysArray)
Create the decoration overlay for the base image using the array of
provided overlays.
|
DecorationOverlayIcon(Image baseImage,
ImageDescriptor[] overlaysArray,
Point sizeValue)
Create the decoration overlay for the base image using the array of
provided overlays.
|
DecorationOverlayIcon(Image baseImage,
ImageDescriptor overlayImage,
int quadrant)
Create a decoration overlay icon that will place the given overlay icon in
the given quadrant of the base image.
|
Modifier and Type | Method and Description |
---|---|
protected void |
drawCompositeImage(int width,
int height)
Draw the composite images.
|
boolean |
equals(Object o) |
protected Point |
getSize()
Return the size of this composite image.
|
protected int |
getTransparentPixel()
Return the transparent pixel for the receiver.
|
int |
hashCode() |
autoScaleDown, autoScaleUp, createCachedImageDataProvider, createCachedImageDataProvider, drawImage, drawImage, getImageData, getImageData, getZoomLevel, setImageData, supportsZoomLevel
createFromFile, createFromImage, createFromImage, createFromImageData, createFromImageDataProvider, createFromURL, createImage, createImage, createImage, createImage, createResource, createWithFlags, destroyResource, getMissingImageDescriptor
public DecorationOverlayIcon(Image baseImage, ImageDescriptor[] overlaysArray, Point sizeValue)
IDecoration
(IDecoration.TOP_LEFT
, IDecoration.TOP_RIGHT
,
IDecoration.BOTTOM_LEFT
, IDecoration.BOTTOM_RIGHT
,
IDecoration.UNDERLAY
, and IDecoration.REPLACE
).baseImage
- the base imageoverlaysArray
- the overlay images, may contain null valuessizeValue
- the size of the resulting imagepublic DecorationOverlayIcon(Image baseImage, ImageDescriptor[] overlaysArray)
IDecoration
(IDecoration.TOP_LEFT
, IDecoration.TOP_RIGHT
,
IDecoration.BOTTOM_LEFT
, IDecoration.BOTTOM_RIGHT
,
IDecoration.UNDERLAY
, and IDecoration.REPLACE
).baseImage
- the base imageoverlaysArray
- the overlay images, may contain null valuespublic DecorationOverlayIcon(Image baseImage, ImageDescriptor overlayImage, int quadrant)
baseImage
- the base imageoverlayImage
- the overlay imagequadrant
- the quadrant (one of IDecoration
(IDecoration.TOP_LEFT
, IDecoration.TOP_RIGHT
,
IDecoration.BOTTOM_LEFT
, IDecoration.BOTTOM_RIGHT
or IDecoration.UNDERLAY
)public DecorationOverlayIcon(ImageDescriptor baseImageDescriptor, ImageDescriptor overlayImageDescriptor, int quadrant)
baseImageDescriptor
- the base image descriptoroverlayImageDescriptor
- the overlay image descriptorquadrant
- the quadrant (one of IDecoration
(IDecoration.TOP_LEFT
, IDecoration.TOP_RIGHT
,
IDecoration.BOTTOM_LEFT
,
IDecoration.BOTTOM_RIGHT
or
IDecoration.UNDERLAY
)protected void drawCompositeImage(int width, int height)
CompositeImageDescriptor
Subclasses must implement this framework method to paint images within
the given bounds using one or more calls to the
CompositeImageDescriptor.drawImage(ImageDataProvider, int, int)
framework method.
Implementers that need to perform computations based on the size of
another image are advised to use one of the
CompositeImageDescriptor.createCachedImageDataProvider(org.eclipse.swt.graphics.Image)
methods to create a
CompositeImageDescriptor.CachedImageDataProvider
that can serve as
ImageDataProvider
. The CompositeImageDescriptor.CachedImageDataProvider
offers
other interesting methods like getWidth()
or
computeInPoints(...)
that can be useful to compute values in points,
based on the resolution-dependent ImageData
that is applicable
for the current drawing operation.
drawCompositeImage
in class CompositeImageDescriptor
width
- the widthheight
- the heightCompositeImageDescriptor.drawImage(ImageDataProvider, int, int)
,
CompositeImageDescriptor.createCachedImageDataProvider(Image)
,
CompositeImageDescriptor.createCachedImageDataProvider(ImageDescriptor)
protected Point getSize()
CompositeImageDescriptor
Subclasses must implement this framework method.
getSize
in class CompositeImageDescriptor
protected int getTransparentPixel()
CompositeImageDescriptor
getTransparentPixel
in class CompositeImageDescriptor
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.