Package eu.simuline.util.images
Class GifResource
- java.lang.Object
-
- eu.simuline.util.images.GifResource
-
- Direct Known Subclasses:
Close,ClosePressed,Collapsed,CollapsedRtl,Computer,Delete,Directory,Directory,Directory,Directory,Error,ExecuteProject,Expanded,File,File,File,File,Floppy,Hammer,HardDrive,HomeFolder,Iconify,IconifyPressed,Inform,Magnify,Maximize,MaximizePressed,Menu,Minimize,MinimizePressed,New,NewFolder,Open,Open,PaletteClose,PaletteClosePressed,Question,RotCCDown,RotCCLeft,Stop,UpFolder,Warn,Warn
public abstract class GifResource extends Object
Provides a single method only,getIcon(Class), which returns the icon associated with the given class. The class must be a subclass ofGifResourceas isOpen. That class is also an example for usingGifResources: Just derive a class fromGifResourceand put it into a package (org.javalobby.icons16x16in this case) pointing to the according gif-image which can be found in this case insrc/main/resources/org/javalobby/icons16x16/Open.gif. Created: Sun Jun 4 20:50:12 2006- Version:
- 1.0
- Author:
- Ernst Reissner
-
-
Constructor Summary
Constructors Constructor Description GifResource()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ImageIcongetIcon(Class<? extends GifResource> res)Converts a GifResource class into the corresponding icon.static voidmain(String[] args)
-
-
-
Method Detail
-
getIcon
public static ImageIcon getIcon(Class<? extends GifResource> res)
Converts a GifResource class into the corresponding icon. This is done in the following steps: If the image is cached inGIFS, take this one. Else load it intoGIFSas described below before taking it fromGIFS.Loading an image consists in loading the class-file associated with the image, determining the according gif-file and creating the according ImageIcon.
- Parameters:
res- a subclass of GifResource.- Returns:
- the icon determined by the given class.
CAUTION: Note that an icon is returned even if there is no according gif-image. This image can be identified by width
-1which is an undocumented property.
-
main
public static final void main(String[] args)
-
-