Xj3D 2.0 VRML/X3D Code API

org.xj3d.ui.swt.widgets
Class ImageLoader

java.lang.Object
  extended by org.xj3d.ui.swt.widgets.ImageLoader

public class ImageLoader
extends java.lang.Object

A convenience class that loads Images for Xj3D's internal uses and provides a caching mechanism.

Version:
$Revision: 1.4 $
Author:
Rex Melton

Constructor Summary
ImageLoader()
           
 
Method Summary
static void dispose()
          Explicitly dispose of all images in the cache
static void initializeCache(java.util.Map resourceMap)
          Initialize the cache of loaded images from the argument map.
static org.eclipse.swt.graphics.Image loadImage(org.eclipse.swt.widgets.Display display, java.lang.String name, ErrorReporter reporter)
          Load an image for the named image file.
 
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

initializeCache

public static void initializeCache(java.util.Map resourceMap)
Initialize the cache of loaded images from the argument map.

Parameters:
resourceMap - - A map containing images keyed by their path.

loadImage

public static org.eclipse.swt.graphics.Image loadImage(org.eclipse.swt.widgets.Display display,
                                                       java.lang.String name,
                                                       ErrorReporter reporter)
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.

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

dispose

public static void dispose()
Explicitly dispose of all images in the cache


Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium