Class DecorationOverlayIcon
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).- Since:
- 3.3
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jface.resource.CompositeImageDescriptor
CompositeImageDescriptor.CachedImageDataProvider
-
Field Summary
Fields inherited from class org.eclipse.jface.resource.ImageDescriptor
DEFAULT_IMAGE_DATA
-
Constructor Summary
ConstructorDescriptionDecorationOverlayIcon
(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. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
drawCompositeImage
(int width, int height) Draw the composite images.boolean
protected Point
getSize()
Return the size of this composite image.protected int
Return the transparent pixel for the receiver.int
hashCode()
Methods inherited from class org.eclipse.jface.resource.CompositeImageDescriptor
autoScaleDown, autoScaleUp, createCachedImageDataProvider, createCachedImageDataProvider, drawImage, drawImage, getImageData, getImageData, getZoomLevel, setImageData, supportsZoomLevel
Methods inherited from class org.eclipse.jface.resource.ImageDescriptor
createFromFile, createFromImage, createFromImage, createFromImageData, createFromImageDataProvider, createFromURL, createFromURLSupplier, createImage, createImage, createImage, createImage, createResource, createWithFlags, destroyResource, getMissingImageDescriptor, imageDescriptorFromURI
-
Constructor Details
-
DecorationOverlayIcon
Create the decoration overlay for the base image using the array of provided overlays. The indices of the array correspond to the values of the 6 overlay constants defined onIDecoration
(IDecoration.TOP_LEFT
,IDecoration.TOP_RIGHT
,IDecoration.BOTTOM_LEFT
,IDecoration.BOTTOM_RIGHT
,IDecoration.UNDERLAY
, andIDecoration.REPLACE
).- Parameters:
baseImage
- the base imageoverlaysArray
- the overlay images, may contain null valuessizeValue
- the size of the resulting image
-
DecorationOverlayIcon
Create the decoration overlay for the base image using the array of provided overlays. The indices of the array correspond to the values of the 6 overlay constants defined onIDecoration
(IDecoration.TOP_LEFT
,IDecoration.TOP_RIGHT
,IDecoration.BOTTOM_LEFT
,IDecoration.BOTTOM_RIGHT
,IDecoration.UNDERLAY
, andIDecoration.REPLACE
).- Parameters:
baseImage
- the base imageoverlaysArray
- the overlay images, may contain null values
-
DecorationOverlayIcon
Create a decoration overlay icon that will place the given overlay icon in the given quadrant of the base image.- Parameters:
baseImage
- the base imageoverlayImage
- the overlay imagequadrant
- the quadrant (one ofIDecoration
(IDecoration.TOP_LEFT
,IDecoration.TOP_RIGHT
,IDecoration.BOTTOM_LEFT
,IDecoration.BOTTOM_RIGHT
orIDecoration.UNDERLAY
)
-
DecorationOverlayIcon
public 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.- Parameters:
baseImageDescriptor
- the base image descriptoroverlayImageDescriptor
- the overlay image descriptorquadrant
- the quadrant (one ofIDecoration
(IDecoration.TOP_LEFT
,IDecoration.TOP_RIGHT
,IDecoration.BOTTOM_LEFT
,IDecoration.BOTTOM_RIGHT
orIDecoration.UNDERLAY
)- Since:
- 3.13
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
drawCompositeImage
protected void drawCompositeImage(int width, int height) Description copied from class:CompositeImageDescriptor
Draw the composite images.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 aCompositeImageDescriptor.CachedImageDataProvider
that can serve asImageDataProvider
. TheCompositeImageDescriptor.CachedImageDataProvider
offers other interesting methods likegetWidth()
orcomputeInPoints(...)
that can be useful to compute values in points, based on the resolution-dependentImageData
that is applicable for the current drawing operation.- Specified by:
drawCompositeImage
in classCompositeImageDescriptor
- Parameters:
width
- the widthheight
- the height- See Also:
-
getSize
Description copied from class:CompositeImageDescriptor
Return the size of this composite image.Subclasses must implement this framework method.
- Specified by:
getSize
in classCompositeImageDescriptor
- Returns:
- the x and y size of the image expressed as a point object
-
getTransparentPixel
protected int getTransparentPixel()Description copied from class:CompositeImageDescriptor
Return the transparent pixel for the receiver. NOTE This value is not currently in use in the default implementation.- Overrides:
getTransparentPixel
in classCompositeImageDescriptor
- Returns:
- int
-