org.apache.myfaces.trinidadinternal.image.painter
Class ImageUtils

java.lang.Object
  extended by org.apache.myfaces.trinidadinternal.image.painter.ImageUtils

public class ImageUtils
extends java.lang.Object

A utility class for working with images.

ImageUtils contains utility functions for:

Version:
$Name: $ ($Revision: adfrt/faces/adf-faces-impl/src/main/java/oracle/adfinternal/view/faces/image/painter/ImageUtils.java#0 $) $Date: 10-nov-2005.19:04:58 $
Author:
The Oracle ADF Faces Team

Method Summary
static java.awt.Image createFilteredImage(java.awt.Image baseImage, java.awt.image.ImageFilter imageFilter)
          Given an image and a filter, creates the resulting image.
static java.awt.Image getImageFromStream(java.io.InputStream in)
          Gets an image from a InputStream of image data.
static java.awt.Image getImageResource(java.lang.Class<?> cl, java.lang.String name)
          Gets an image resource.
static java.awt.Image getNotLoadedImage()
          Returns the special "not loaded" image, indicating that an image failed to be loaded properly.
static boolean isImageLoaded(java.awt.Image image)
          Return true if the Image has been successfully loaded.
static boolean loadImage(java.awt.Image image)
          Synchronously loads a single image.
static boolean loadImages(java.awt.Image[] images)
          Synchronously loads multiple images.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createFilteredImage

public static java.awt.Image createFilteredImage(java.awt.Image baseImage,
                                                 java.awt.image.ImageFilter imageFilter)
Given an image and a filter, creates the resulting image.

Parameters:
baseImage - the base image
imageFilter - the image filter

getImageResource

public static java.awt.Image getImageResource(java.lang.Class<?> cl,
                                              java.lang.String name)
Gets an image resource. If the image cannot be loaded, returns the special "not loaded" image.

Parameters:
cl - the class used to load the resource
name - the path to the resource, relative to the class

getImageFromStream

public static java.awt.Image getImageFromStream(java.io.InputStream in)
Gets an image from a InputStream of image data. If the image cannot be loaded, returns null.

Parameters:
in - The InputStream to use for loading image data. The InputStream is automatically closed once the image data is read.

getNotLoadedImage

public static java.awt.Image getNotLoadedImage()
Returns the special "not loaded" image, indicating that an image failed to be loaded properly.


isImageLoaded

public static boolean isImageLoaded(java.awt.Image image)
Return true if the Image has been successfully loaded.

Parameters:
image - Image to check for sucessful loading

Returns:
True if the image has been sucessfully loaded.

loadImage

public static boolean loadImage(java.awt.Image image)
Synchronously loads a single image.

Returns:
true if the image loaded successfully, false if it failed.

loadImages

public static boolean loadImages(java.awt.Image[] images)
Synchronously loads multiple images.

Returns:
true if all images loaded successfully, false if any failed


Copyright © 2001-2007 Apache Software Foundation. All Rights Reserved.