NextApp Echo
App Container 1.0.5

nextapp.echoservlet.image
Class ImageManager

java.lang.Object
  extended bynextapp.echoservlet.image.ImageManager
All Implemented Interfaces:
java.io.Serializable

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

Manages the images referenced by a ComponentPeer.

See Also:
Serialized Form

Field Summary
private  ComponentPeer componentPeer
          The ComponentPeer for which this ImageManager is managing images.
private  java.util.Map images
          A map that maps image names to image peers.
private static int INITIAL_CAPACITY
           
 
Constructor Summary
ImageManager(ComponentPeer componentPeer)
          Creates an image manager for the specified component.
 
Method Summary
 nextapp.echo.ImageReference getImage(java.lang.String imageName)
          Returns an image managed by this ImageManager, identified by imageName.
 int getImageCount()
          Returns the number of images managed by this ImageManager.
 java.util.Iterator getImageNames()
          Returns an Iterator over the names of images managed by this ImageManager.
 java.lang.String getImageUri(Connection conn, java.lang.String imageName)
          Returns the URI of the image with provided name.
 void removeAllImages()
          Removes all images.
 void setImage(java.lang.String imageName, nextapp.echo.ImageReference newImage)
          Adds an image to the image manager, identified by imageName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INITIAL_CAPACITY

private static final int INITIAL_CAPACITY
See Also:
Constant Field Values

images

private java.util.Map images
A map that maps image names to image peers.


componentPeer

private ComponentPeer componentPeer
The ComponentPeer for which this ImageManager is managing images.

Constructor Detail

ImageManager

public ImageManager(ComponentPeer componentPeer)
Creates an image manager for the specified component.

Parameters:
componentPeer - The ComponentPeer whose images will be managed by this instance.
Method Detail

getImage

public nextapp.echo.ImageReference getImage(java.lang.String imageName)
Returns an image managed by this ImageManager, identified by imageName.

Parameters:
imageName - The name of the image to return.
Returns:
The ImageReference that corresponds to the specified name.

getImageCount

public int getImageCount()
Returns the number of images managed by this ImageManager.

Returns:
The number of images managed by this ImageManager.

getImageNames

public java.util.Iterator getImageNames()
Returns an Iterator over the names of images managed by this ImageManager.

Returns:
An Iterator over the names of images managed by this ImageManager.

getImageUri

public java.lang.String getImageUri(Connection conn,
                                    java.lang.String imageName)
Returns the URI of the image with provided name.

Parameters:
conn - The connection rendering the image URI.
imageName - The name of the image whose URI is to be returned.
Returns:
The URI of the image that corresponds to the specified name.

removeAllImages

public void removeAllImages()
Removes all images.


setImage

public void setImage(java.lang.String imageName,
                     nextapp.echo.ImageReference newImage)
Adds an image to the image manager, identified by imageName.

Parameters:
imageName - A identifier that will be used for the added image.
newImage - The new image to be added.

NextApp Echo
App Container 1.0.5