j3d.org Code

org.j3d.util
Class ImageLoader

java.lang.Object
  extended by org.j3d.util.ImageLoader

public class ImageLoader
extends java.lang.Object

A convenience class that loads Icons for users and provides caching mechanisms.

Internationalisation Resource Names

Version:
$Revision: 1.4 $
Author:
Justin Couch

Constructor Summary
ImageLoader()
           
 
Method Summary
static javax.swing.Icon loadIcon(java.lang.String name)
          Load an icon for the named image file.
static java.awt.Image loadImage(java.lang.String name)
          Load an image for the named image file.
static void setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageLoader

public ImageLoader()
Method Detail

setErrorReporter

public static void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

loadIcon

public static javax.swing.Icon loadIcon(java.lang.String name)
Load an icon for the named image file. Looks in the classpath for the image so the path provided must be fully qualified relative to the classpath. Alternatively a fully qualified URL may be provided to fetch an image from an alternative place other than the classpath.

Parameters:
name - The path to load the icon for. If not found, no image is loaded.
Returns:
An icon for the named path.

loadImage

public static java.awt.Image loadImage(java.lang.String name)
Load an image for the named image file. Looks in the classpath for the image so the path provided must be fully qualified relative to the classpath. Alternatively a fully qualified URL may be provided to fetch an image from an alternative place other than the classpath.

Parameters:
name - The path to load the icon for. If not found, no image is loaded.
Returns:
An image for the named path.

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org