public final class FileEncodedImageAsync
- Object
- Image
- EncodedImage
- FileEncodedImageAsync
ImplementsActionSource
Methods
public static FileEncodedImageAsync create(String fileName, byte[] placeholder, int width, int height) | Deprecated Creates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed. |
public static FileEncodedImageAsync create(String fileName, Image placeholder) | Creates an encoded image that maps to a local file thus allowing to seamlessly fetch files as needed. |
protected void resetCache() | A subclass might choose to load asynchroniously and reset the cache when the image is ready. |
protected Image getInternal() | Returns the actual image represented by the encoded image, this image will be cached in a weak/soft reference internally. |
public byte[] getImageData() | Returns the byte array data backing the image allowing the image to be stored and discarded completely from RAM. |
public boolean animate() | Advances this image’s animation state, if it is animated. |
public boolean isAnimation() | Returns true if this is an animated image |
Inherited methods
From EncodedImage
createMulti, createFromImage, createFromRGB, create, create, create, create, create, dispose, isDisposed, getImage, isLocked, asyncLock, lock, unlock, subImage, rotate, modifyAlpha, modifyAlpha, getGraphics, getWidth, getHeight, drawImage, drawImage, toRGB, scaledWidth, scaledHeight, scaledSmallerRatio, scaledEncoded, scaled, scale, isOpaque
From Image
isSimdOptimizationsEnabled, setSimdOptimizationsEnabled, resetSimdOptimizationsEnabled, isSVGSupported, createSVG, createIndexed, createImage, createImage, createImage, createImage, createImage, isAlphaMutableImageSupported, createImage, createImage, exifRotation, exifRotation, exifRotation, getExifOrientationTag, getExifOrientationTag, isJPEG, isPNG, getSVGDocument, isSVG, createMask, applyMask, applyMask, applyMaskAutoScale, mirror, modifyAlphaWithTranslucency, getRGB, getRGB, getRGBCached, scaledLargerRatio, fill, getImageName, setImageName, rotate90Degrees, rotate180Degrees, rotate270Degrees, flipHorizontally, flipVertically, requiresDrawImage, addActionListener, removeActionListener, fireChangedEvent
Method details
create
public static FileEncodedImageAsync create(String fileName, byte[] placeholder, int width, int height)Parameters
fileNameString- the name of the file
placeholderbyte[]- a placeholder image until the actual image loads
widthint- the width of the file or -1 if unknown (notice that this will improve performance)
heightint- the height of the file or -1 if unknown (notice that this will improve performance)
Returns
create
public static FileEncodedImageAsync create(String fileName, Image placeholder)Parameters
fileNameString- the name of the file
placeholderImage- an image that will occupy the space
Returns
resetCache
protected void resetCache()getInternal
protected Image getInternal()Returns
getImageData
public byte[] getImageData()Returns
animate
public boolean animate()Returns
true if the animation state changed.isAnimation
public boolean isAnimation()