Package org.eclipse.jface.resource
Class CompositeImageDescriptor.CachedImageDataProvider
java.lang.Object
org.eclipse.jface.resource.CompositeImageDescriptor.CachedImageDataProvider
- All Implemented Interfaces:
ImageDataProvider
- Enclosing class:
- CompositeImageDescriptor
@NoExtend
protected abstract class CompositeImageDescriptor.CachedImageDataProvider
extends Object
implements ImageDataProvider
An
ImageDataProvider that caches the most recently returned
ImageData object. I.e. consecutive calls to
ImageDataProvider.getImageData(int) with the same zoom level are cheap.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcomputeInPoints(ToIntFunction<ImageData> function) Returns a computed value in SWT logical points.intReturns theImageData.heightin points.intgetWidth()Returns theImageData.widthin points.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.swt.graphics.ImageDataProvider
getImageData
-
Constructor Details
-
CachedImageDataProvider
protected CachedImageDataProvider()
-
-
Method Details
-
getWidth
public int getWidth()Returns theImageData.widthin points. This method must only be called within the dynamic scope of a call toCompositeImageDescriptor.drawCompositeImage(int, int).- Returns:
- the width in points
-
getHeight
public int getHeight()Returns theImageData.heightin points. This method must only be called within the dynamic scope of a call toCompositeImageDescriptor.drawCompositeImage(int, int).- Returns:
- the height in points
-
computeInPoints
Returns a computed value in SWT logical points. The given function computes a value in pixels, based on information from the given ImageData, which is also in pixels. This method must only be called within the dynamic scope of a call toCompositeImageDescriptor.drawCompositeImage(int, int).- Parameters:
function- a function that takes anImageDataand computes a value in pixels- Returns:
- the computed value in points
-