|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jfig.gui.ImageHelper
find and load images from files, URLs, Java resources.
ImageHelper: a not-so-simple utility class to load and create images. One typical use is to create backbround images for buffering while the main user interface is still under construction. (This class won't be necessary, except for all those AWT bugs... )
Field Summary | |
(package private) static java.lang.String |
appletBaseDirName
|
(package private) static java.net.URL |
appletCodeBase
|
(package private) static java.lang.String |
appletServerName
|
(package private) static boolean |
debug
|
(package private) static ConsoleMessage |
printer
|
(package private) static java.awt.Component |
visibleParent
|
Constructor Summary | |
ImageHelper()
|
Method Summary | |
static void |
checkParentIsVisible()
Based on experimental evidence, at least older versions of the AWT required that a toplevel component (a Frame) was visible before any of the image creation methods worked. |
static java.awt.Image |
createImage(java.awt.image.ImageProducer producer)
|
static java.awt.Image |
createImage(int width,
int height)
|
static void |
dbg(java.lang.String msg)
|
static java.awt.Image |
findImage(java.lang.String type,
java.lang.String pathname,
java.lang.String imgname)
A method to find and load images whose name is relative to some base URL/directory/path. |
static java.awt.Image |
findImageFromFile(java.lang.String pathname,
java.lang.String imgname)
|
static java.awt.Image |
findImageFromResource(java.lang.String pathname,
java.lang.String imgname)
Unlike loadResourceImage, this method does not use a MediaTracker to synchronize the loading. |
static java.awt.Image |
findImageFromURL(java.lang.String urlname)
|
static java.awt.Image |
findImageFromURL(java.lang.String pathname,
java.lang.String imgname)
|
static boolean |
getDebug()
|
static java.awt.Image |
getFilteredImage(java.awt.Image src,
java.awt.image.ImageFilter filter)
|
static java.awt.Image |
getInvertedImage(java.awt.Image src)
|
static java.awt.Image |
loadResourceImage(java.lang.String resourcename)
|
static void |
main(java.lang.String[] argv)
|
static void |
message(java.lang.String msg)
|
static void |
setAppletBaseDir(java.lang.String name)
|
static void |
setAppletServerName(java.lang.String name)
set the applet server and base directory for later loadResourceImage() calls, e.g. |
static void |
setConsole(ConsoleMessage p)
|
static void |
setDebug(boolean b)
|
static void |
setVisibleParent(java.awt.Component parent)
|
static void |
trace(java.lang.Throwable e)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static java.awt.Component visibleParent
static ConsoleMessage printer
static java.lang.String appletServerName
static java.lang.String appletBaseDirName
static java.net.URL appletCodeBase
static boolean debug
Constructor Detail |
public ImageHelper()
Method Detail |
public static void setConsole(ConsoleMessage p)
public static void message(java.lang.String msg)
public static void dbg(java.lang.String msg)
public static void setDebug(boolean b)
public static boolean getDebug()
public static void trace(java.lang.Throwable e)
public static void setVisibleParent(java.awt.Component parent)
public static void checkParentIsVisible()
public static void setAppletServerName(java.lang.String name)
ImageHelper.setAppletServerName( "http://tech-www.informatik.uni-hamburg.de" ); ImageHelper.setAppletBaseDir( "/applets/hades/classes" ); Image icon = ImageHelper.loadResourceImage( "/hades/gui/images/icon.gif" );
public static void setAppletBaseDir(java.lang.String name)
public static java.awt.Image loadResourceImage(java.lang.String resourcename)
public static java.awt.Image createImage(int width, int height)
public static java.awt.Image createImage(java.awt.image.ImageProducer producer)
public static java.awt.Image findImage(java.lang.String type, java.lang.String pathname, java.lang.String imgname)
The basic algorithm performed by findImage() is as follows:
findImage() knows about the following filename types:
public static java.awt.Image findImageFromURL(java.lang.String pathname, java.lang.String imgname)
public static java.awt.Image findImageFromURL(java.lang.String urlname)
public static java.awt.Image findImageFromFile(java.lang.String pathname, java.lang.String imgname)
public static java.awt.Image findImageFromResource(java.lang.String pathname, java.lang.String imgname)
public static java.awt.Image getFilteredImage(java.awt.Image src, java.awt.image.ImageFilter filter)
public static java.awt.Image getInvertedImage(java.awt.Image src)
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |