nextapp.echo
Class AwtImageReference

java.lang.Object
  extended by nextapp.echo.AbstractImageReference
      extended by nextapp.echo.AwtImageReference
All Implemented Interfaces:
java.io.Serializable, ImageReference

public class AwtImageReference
extends AbstractImageReference

A reference to a java.awt.Image. The JVM running the Echo Application Container will require access to a graphics context if AwtImageReferences are used.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nextapp.echo.AbstractImageReference
listenerList
 
Fields inherited from interface nextapp.echo.ImageReference
SIZE_UNKNOWN
 
Constructor Summary
AwtImageReference(java.awt.Image image)
          Creates a reference to a java.awt.Image.
 
Method Summary
 int getHeight()
          Returns the height of the image in pixels.
 java.awt.Image getImage()
          Retrieves the image.
 int getWidth()
          Returns the width of the image in pixels.
 
Methods inherited from class nextapp.echo.AbstractImageReference
addImageUpdateListener, removeImageUpdateListener, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AwtImageReference

public AwtImageReference(java.awt.Image image)
Creates a reference to a java.awt.Image. If the image is modified after instantiation you should dispose of any AwtImageReference instances that reference it and create new ones.

Parameters:
image - A java.awt.Image to be displayed. If you intend to extend this class and override the getImage() method to return images only as they are needed, then you may pass null to this parameter.
Method Detail

getImage

public java.awt.Image getImage()
Retrieves the image. Calls to this method will be minimized such that applications may extend this class and override this method such that images are created only when they are needed, thereby reducing memory usage at the cost of increased processor workload.


getHeight

public int getHeight()
Returns the height of the image in pixels.

Returns:
The height of the image in pixels.
See Also:
ImageReference.getHeight()

getWidth

public int getWidth()
Returns the width of the image in pixels.

Returns:
The width of the image in pixels.
See Also:
ImageReference.getWidth()