com.inet.html.image
Class RemoteImage

java.lang.Object
  extended by com.inet.html.image.RemoteImage

public class RemoteImage
extends java.lang.Object

This class proxies an image which is about to be loaded by the ImageFetcher


Field Summary
static int STATUS_FINISHED
           
static int STATUS_INVALID
           
static int STATUS_LOADING
           
static int STATUS_NEW
           
 
Constructor Summary
RemoteImage(java.awt.Image content)
          Creates the image.
RemoteImage(java.net.URL location)
          Creates the image.
 
Method Summary
 void addObserver(java.awt.image.ImageObserver observer)
          Adds an ImageObserver
 java.awt.Image getContent()
          Returns the content of the proxy.
 int getHeight()
          Returns the height of the image, may be 0 as long as the image was not loaded
 java.net.URL getLocation()
          Returns the location URL of this image
 int getStatus()
          Returns the current loading status of the image
 int getWidth()
          Returns the width of the image, may be 0 as long as the image was not loaded
 void imageUpdate(int infoflags, int x, int y, int width, int height)
          Notifies all registered image observers
 void removeObserver(java.awt.image.ImageObserver observer)
          Removes an image observer
 void setContent(java.awt.Image content)
          Sets the content of the proxy.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_NEW

public static final int STATUS_NEW
See Also:
Constant Field Values

STATUS_LOADING

public static final int STATUS_LOADING
See Also:
Constant Field Values

STATUS_FINISHED

public static final int STATUS_FINISHED
See Also:
Constant Field Values

STATUS_INVALID

public static final int STATUS_INVALID
See Also:
Constant Field Values
Constructor Detail

RemoteImage

public RemoteImage(java.net.URL location)
Creates the image. NOTE: This image will not auto-load! Use the ImageFetcher to get images of this type

Parameters:
location - the location to load the image from

RemoteImage

public RemoteImage(java.awt.Image content)
Creates the image.

Parameters:
content - the image content to display
Method Detail

getLocation

public java.net.URL getLocation()
Returns the location URL of this image

Returns:
the location URL of this image, not null

getHeight

public int getHeight()
Returns the height of the image, may be 0 as long as the image was not loaded

Returns:
the height of the image, may be 0 as long as the image was not loaded

getWidth

public int getWidth()
Returns the width of the image, may be 0 as long as the image was not loaded

Returns:
the width of the image, may be 0 as long as the image was not loaded

addObserver

public void addObserver(java.awt.image.ImageObserver observer)
Adds an ImageObserver

Parameters:
observer - the observer to add

removeObserver

public void removeObserver(java.awt.image.ImageObserver observer)
Removes an image observer

Parameters:
observer - the observer to remove

imageUpdate

public void imageUpdate(int infoflags,
                        int x,
                        int y,
                        int width,
                        int height)
Notifies all registered image observers

Parameters:
infoflags - the bitwise inclusive OR of the following flags: WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT.
x - the x coordinate.
y - the y coordinate.
width - the width.
height - the height.
See Also:
ImageObserver

getStatus

public int getStatus()
Returns the current loading status of the image

Returns:
the current loading status of the image
See Also:
STATUS_NEW, STATUS_LOADING, STATUS_FINISHED, STATUS_INVALID

setContent

public void setContent(java.awt.Image content)
Sets the content of the proxy. This is the actual content, which should be loaded by the fetcher!

Parameters:
content - the content of the proxy

getContent

public java.awt.Image getContent()
Returns the content of the proxy. This is the actual content, which should be loaded by the fetcher!

Returns:
content the content of the proxy

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object