public class ImageManager extends Object implements IImageManager
| Modifier and Type | Method and Description |
|---|---|
ImageIcon |
getCachedImage(String name)
Get the
ImageIcon if it is available in the cache. |
ClassLoader |
getClassLoader()
Gets the class loader for resources, null for none (i.e.
|
ImageIcon |
getImage(String name)
Gets a cached image from the resource URL.
|
ImageIcon |
getImage(String name,
boolean keepInCache)
Gets a [cached] image from the resource URL.
|
ImageIcon |
getImage(URL url)
Gets a non-cached image from the resource URL.
|
URL |
getResourceURL()
Gets the resource URL.
|
double |
getScaleX()
Gets the scaling factor for images in X.
|
double |
getScaleY()
Gets the scaling factor for images in X.
|
void |
setImageScaling(double x,
double y)
Assigns the image scaling and clears the image cache (that might contain [scaled] images),
if the values are different.
|
void |
setResourceURL(String resDir)
Sets the resource URL.
|
void |
setTemporaryResourceURL(String resDir)
Sets a temporary relative resource URL.
|
public void setTemporaryResourceURL(String resDir)
public void setImageScaling(double x,
double y)
x - The X-scaling factor, must be greater than zero.y - The Y-scaling factor, must be greater than zero.IllegalArgumentException - for x or y zero or smaller.public void setResourceURL(String resDir)
If the resource URL contains the tag "@**SERVER@", the tag will be substituted with the host name for the host currently used. This makes it possible to have the resource URL follow to a backup server and load balancing.
If the resource URL contains the tag "@**PORT@", the tag will be substituted with the port number for the host currently used. This makes it possible to have the resource URL follow to a backup server and load balancing.
resDir - The resource URL.public ClassLoader getClassLoader()
public URL getResourceURL()
public double getScaleX()
getScaleX in interface IImageManagerpublic double getScaleY()
getScaleY in interface IImageManagerpublic ImageIcon getImage(URL url)
url - The URL to load the image from.public ImageIcon getCachedImage(String name)
ImageIcon if it is available in the cache.getCachedImage in interface IImageManagername - The image name.public ImageIcon getImage(String name)
getImage in interface IImageManagername - The image name.public ImageIcon getImage(String name, boolean keepInCache)
getImage in interface IImageManagername - The image name.keepInCache - Flag to keep image in cache or not.Phantom® and NetPhantom® are registered trademarks of Mindus SARL.
© © Mindus SARL, 2024. All rights reserved.