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
-
ImageRef(String)
- Constructs a new instance of ImageRef given the name of a file
for the image.
-
ImageRef(URL)
- Constructs a new instance of ImageRef that use a
URL to find the image when it is requested.
-
getFileName()
- Returns the file name of the image.
-
getHeight(Component, Applet)
- Returns the height of the image.
-
getImage(Component, Applet)
- Gets the image stored here (or referenced by the URL).
-
getURL()
- Returns the URL stored here.
-
getWidth(Component, Applet)
- Returns the width of the image.
-
imageUpdate(Image, int, int, int, int, int)
- Gets called when an update of the image's width and height are available.
-
toString()
- Returns the preferred string representation of this image reference.
-
verifyImage(Component, Applet)
- Verifies that the image for this image ref loaded successfully,
returns true if it does.
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.
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".
getImage
public Image getImage(Component comp,
Applet applet)
- Gets the image stored here (or referenced by the URL).
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.
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.
getURL
public URL getURL()
- Returns the URL stored here.
getFileName
public String getFileName()
- Returns the file name of the image.
toString
public String toString()
- Returns the preferred string representation of this image reference.
- Overrides:
- toString in class Object
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.
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