Class sunsoft.jws.visual.rt.type.ImageRef
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunsoft.jws.visual.rt.type.ImageRef

java.lang.Object
   |
   +----sunsoft.jws.visual.rt.type.ImageRef

public class ImageRef
extends Object
implements ImageObserver
Stores an image and the URL or filename that it came from. This class is capable of converting a filename to a URL and will do so in order to load the image using a "file:" URL. The creation of the image is delayed until the image is requested.
See Also:
Image

Constructor Index

 o ImageRef(String)
Constructs a new instance of ImageRef given the name of a file for the image.
 o ImageRef(URL)
Constructs a new instance of ImageRef that use a URL to find the image when it is requested.

Method Index

 o getFileName()
Returns the file name of the image.
 o getHeight(Component, Applet)
Returns the height of the image.
 o getImage(Component, Applet)
Gets the image stored here (or referenced by the URL).
 o getURL()
Returns the URL stored here.
 o getWidth(Component, Applet)
Returns the width of the image.
 o imageUpdate(Image, int, int, int, int, int)
Gets called when an update of the image's width and height are available.
 o toString()
Returns the preferred string representation of this image reference.
 o verifyImage(Component, Applet)
Verifies that the image for this image ref loaded successfully, returns true if it does.

Constructors

 o ImageRef
  public ImageRef(URL url)
Constructs a new instance of ImageRef that use a URL to find the image when it is requested. The size of the image cannot be appended to the URL.
 o ImageRef
  public ImageRef(String filename)
Constructs a new instance of ImageRef given the name of a file for the image. The filename may be relative to the codebase or any of the directories in the classpath. The size of the image may be appended to the filename to help with initial layout of widgets containing images, like this: "imagefile.gif;24x48".

Methods

 o getImage
  public Image getImage(Component comp,
                        Applet applet)
Gets the image stored here (or referenced by the URL).
 o getWidth
  public int getWidth(Component comp,
                      Applet applet)
Returns the width of the image. If the image is not yet loaded, then returns the expected width of the image.
 o getHeight
  public int getHeight(Component comp,
                       Applet applet)
Returns the height of the image. If the image is not yet loaded, then returns the expected height of the image.
 o getURL
  public URL getURL()
Returns the URL stored here.
 o getFileName
  public String getFileName()
Returns the file name of the image.
 o toString
  public String toString()
Returns the preferred string representation of this image reference.
Overrides:
toString in class Object
 o verifyImage
  public boolean verifyImage(Component comp,
                             Applet applet)
Verifies that the image for this image ref loaded successfully, returns true if it does. Warning: will wait until image is loaded before returning, so you shouldn't make this call unless you are really interested in reporting an error message when images can't be loaded.
 o imageUpdate
  public boolean imageUpdate(Image img,
                             int infoflags,
                             int x,
                             int y,
                             int width,
                             int height)
Gets called when an update of the image's width and height are available.

All Packages  Class Hierarchy  This Package  Previous  Next  Index