public class MapImageCacheEntry
extends java.lang.Object
ImageType
.Constructor and Description |
---|
MapImageCacheEntry(@NotNull CacheFiles cacheFiles,
@NotNull java.awt.Image defaultImage,
@NotNull java.lang.String prefix)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
flush(@NotNull java.io.File mapFile)
Removes the cached image for a map file.
|
@NotNull java.awt.Image |
getDefaultImage()
Returns the default image.
|
@Nullable java.awt.Image |
lookupCache(@NotNull java.io.File mapFile)
Looks up an image from the cache.
|
@NotNull java.awt.Image |
scaleImage(@Nullable java.io.File mapFile,
@NotNull java.awt.Image image,
int width,
int height)
Scales an
Image to the given size and updates the cache. |
public MapImageCacheEntry(@NotNull @NotNull CacheFiles cacheFiles, @NotNull @NotNull java.awt.Image defaultImage, @NotNull @NotNull java.lang.String prefix)
cacheFiles
- the cache files for generating files for caching icons
and previewsdefaultImage
- the default imageprefix
- the directory prefix for the cache directorypublic void flush(@NotNull @NotNull java.io.File mapFile)
mapFile
- the map file to flush@Nullable public @Nullable java.awt.Image lookupCache(@NotNull @NotNull java.io.File mapFile)
mapFile
- the map file to look upnull
if the cache does not contain an entry
for mapFile
or if the entry is outdated@NotNull public @NotNull java.awt.Image getDefaultImage()
@NotNull public @NotNull java.awt.Image scaleImage(@Nullable @Nullable java.io.File mapFile, @NotNull @NotNull java.awt.Image image, int width, int height)
Image
to the given size and updates the cache. If an
out of memory error occurs the default image is returned.mapFile
- the map file for the imageimage
- the image to scalewidth
- the scaled widthheight
- the scaled height