rcx.rcxtools.filebrowser
Class ImageManager

java.lang.Object
  extended by rcx.rcxtools.filebrowser.ImageManager
All Implemented Interfaces:
java.io.Serializable

public class ImageManager
extends java.lang.Object
implements java.io.Serializable

This class enable Image loading and painting. Images that are created from a URL or filename are preloaded using MediaTracker to monitor the loaded state of the image.

From the swing package (ImageIcon.java)

Version:
1.16 10/06/97
Author:
Jeff Dinkins
See Also:
Serialized Form

Constructor Summary
ImageManager()
          Creates an uninitialized image icon.
ImageManager(java.awt.Image image)
          Creates an ImageManager from the image.
ImageManager(java.awt.Image image, java.lang.String description)
          Creates an ImageManager from the image.
ImageManager(java.lang.String filename)
          Creates an ImageManager from the specified file.
ImageManager(java.lang.String filename, java.lang.String description)
          Creates an ImageManager from the specified file.
ImageManager(java.net.URL location)
          Creates an ImageManager from the specified URL.
ImageManager(java.net.URL location, java.lang.String description)
          Creates an ImageManager from the specified URL.
 
Method Summary
 java.lang.String getDescription()
          Get the description of the image.
 int getIconHeight()
          Get the height of the Icon
 int getIconWidth()
          Get the width of the Icon
 java.awt.Image getImage()
          Returns the Icon's Image
 java.awt.image.ImageObserver getImageObserver()
          Return the umage observer for the image
static boolean isValidImage(java.net.URL url)
          Returns true if the specified URL locates a valid image, false otherwise.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Deprecated.  
 void paintIcon(java.awt.Graphics g, int x, int y)
          Paints the Icon
 void paintIcon(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color bgcolor)
          Paints the Icon
 void paintIcon(java.awt.Graphics g, int x, int y, int w, int h, int sx, int sy, int sw, int sh)
          Paints the Icon
 void paintIcon(java.awt.Graphics g, int x, int y, int w, int h, int sx, int sy, int sw, int sh, java.awt.Color bgcolor)
          Paints the Icon
 void setDescription(java.lang.String description)
          Set the description of the image.
 void setImage(java.awt.Image image)
          Set the image displayed by this icon.
 void setImageObserver(java.awt.image.ImageObserver observer)
          Set the image observer for the image.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageManager

public ImageManager(java.lang.String filename,
                    java.lang.String description)
Creates an ImageManager from the specified file. The image will be preloaded by using MediaTracker to monitor the loading state of the image.

Parameters:
filename - the name of the file containing the image
description - a brief textual description of the image

ImageManager

public ImageManager(java.lang.String filename)
Creates an ImageManager from the specified file. The image will be preloaded by using MediaTracker to monitor the loading state of the image.


ImageManager

public ImageManager(java.net.URL location,
                    java.lang.String description)
Creates an ImageManager from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded state of the image.

Parameters:
URL - the URL for the image
description - a brief textual description of the image

ImageManager

public ImageManager(java.net.URL location)
Creates an ImageManager from the specified URL. The image will be preloaded by using MediaTracker to monitor the loaded state of the image.


ImageManager

public ImageManager(java.awt.Image image,
                    java.lang.String description)
Creates an ImageManager from the image.

Parameters:
image - the image
description - a brief textual description of the image

ImageManager

public ImageManager(java.awt.Image image)
Creates an ImageManager from the image.


ImageManager

public ImageManager()
Creates an uninitialized image icon.

Method Detail

getImage

public java.awt.Image getImage()
Returns the Icon's Image


setImage

public void setImage(java.awt.Image image)
Set the image displayed by this icon.


getDescription

public java.lang.String getDescription()
Get the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image.


setDescription

public void setDescription(java.lang.String description)
Set the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image.


paintIcon

public void paintIcon(java.awt.Graphics g,
                      int x,
                      int y)
Paints the Icon


paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Deprecated. 

Paints the Icon


paintIcon

public void paintIcon(java.awt.Graphics g,
                      int x,
                      int y,
                      int w,
                      int h,
                      java.awt.Color bgcolor)
Paints the Icon


paintIcon

public void paintIcon(java.awt.Graphics g,
                      int x,
                      int y,
                      int w,
                      int h,
                      int sx,
                      int sy,
                      int sw,
                      int sh)
Paints the Icon


paintIcon

public void paintIcon(java.awt.Graphics g,
                      int x,
                      int y,
                      int w,
                      int h,
                      int sx,
                      int sy,
                      int sw,
                      int sh,
                      java.awt.Color bgcolor)
Paints the Icon


getIconWidth

public int getIconWidth()
Get the width of the Icon


getIconHeight

public int getIconHeight()
Get the height of the Icon


setImageObserver

public void setImageObserver(java.awt.image.ImageObserver observer)
Set the image observer for the image. Set this property if the ImageManager contains an animated GIF. For example:
     icon = new ImageManager(...)
     button.setImage(icon);
     icon.setImageObserver(button);
 


getImageObserver

public java.awt.image.ImageObserver getImageObserver()
Return the umage observer for the image


isValidImage

public static boolean isValidImage(java.net.URL url)
Returns true if the specified URL locates a valid image, false otherwise.

Parameters:
URL - the URL to check