CH.ifa.draw.util
Class Iconkit
- java.lang.Object
-
- CH.ifa.draw.util.Iconkit
-
public class Iconkit extends java.lang.ObjectThe Iconkit class supports the sharing of images. It maintains a map of image names and their corresponding images. Iconkit also supports to load a collection of images in synchronized way. The resolution of a path name to an image is delegated to the DrawingEditor.
Design Patterns
Singleton
The Iconkit is a singleton.
-
-
Constructor Summary
Constructors Constructor and Description Iconkit(java.awt.Component component)Constructs an Iconkit that uses the given editor to resolve image path names.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.awt.ImagegetImage(java.lang.String filename)Gets the image with the given name.static Iconkitinstance()Gets the single instancejava.awt.ImageloadImage(java.lang.String filename)Loads an image with the given name.java.awt.ImageloadImageResource(java.lang.String resourcename)voidloadRegisteredImages(java.awt.Component component)Loads all registered images.java.awt.ImageregisterAndLoadImage(java.awt.Component component, java.lang.String fileName)Registers and loads an image.voidregisterImage(java.lang.String fileName)Registers an image that is then loaded together with the other registered images by loadRegisteredImages.
-
-
-
Constructor Detail
-
Iconkit
public Iconkit(java.awt.Component component)
Constructs an Iconkit that uses the given editor to resolve image path names.
-
-
Method Detail
-
instance
public static Iconkit instance()
Gets the single instance
-
loadRegisteredImages
public void loadRegisteredImages(java.awt.Component component)
Loads all registered images.- See Also:
registerImage(java.lang.String)
-
registerImage
public void registerImage(java.lang.String fileName)
Registers an image that is then loaded together with the other registered images by loadRegisteredImages.- See Also:
loadRegisteredImages(java.awt.Component)
-
registerAndLoadImage
public java.awt.Image registerAndLoadImage(java.awt.Component component, java.lang.String fileName)Registers and loads an image.
-
loadImage
public java.awt.Image loadImage(java.lang.String filename)
Loads an image with the given name.
-
loadImageResource
public java.awt.Image loadImageResource(java.lang.String resourcename)
-
getImage
public java.awt.Image getImage(java.lang.String filename)
Gets the image with the given name. If the image can't be found it tries it again after loading all the registered images.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG