com.google.gwt.libideas.resources.client.impl
Class ImageResourcePrototype

java.lang.Object
  extended by com.google.gwt.libideas.resources.client.impl.ImageResourcePrototype
All Implemented Interfaces:
ImageResource, ResourcePrototype

public class ImageResourcePrototype
extends java.lang.Object
implements ImageResource

This is part of an implementation of the ImageBundle optimization implemented with ImmutableResourceBundle.


Constructor Summary
ImageResourcePrototype(java.lang.String name, java.lang.String url, int left, int top, int width, int height)
           
 
Method Summary
 void applyTo(com.google.gwt.user.client.ui.Image image)
          Transforms an existing Image into the image represented by this prototype.
 com.google.gwt.user.client.ui.Image createImage()
          Creates a new Image instance based on the image represented by this prototype.
 int getHeight()
          Exists for testing purposes, not part of the ImageResource interface.
 java.lang.String getHTML()
          Gets an HTML fragment that displays the image represented by this prototype.
 int getLeft()
          Exists for testing purposes, not part of the ImageResource interface.
 java.lang.String getName()
          Returns the name of the function within the ResourceBundle used to create the ResourcePrototype.
 int getTop()
          Exists for testing purposes, not part of the ImageResource interface.
 java.lang.String getURL()
          Exists for testing purposes, not part of the ImageResource interface.
 int getWidth()
          Exists for testing purposes, not part of the ImageResource interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageResourcePrototype

public ImageResourcePrototype(java.lang.String name,
                              java.lang.String url,
                              int left,
                              int top,
                              int width,
                              int height)
Method Detail

applyTo

public void applyTo(com.google.gwt.user.client.ui.Image image)
Description copied from interface: ImageResource
Transforms an existing Image into the image represented by this prototype.

Specified by:
applyTo in interface ImageResource
Parameters:
image - the instance to be transformed to match this prototype

createImage

public com.google.gwt.user.client.ui.Image createImage()
Description copied from interface: ImageResource
Creates a new Image instance based on the image represented by this prototype.

Specified by:
createImage in interface ImageResource
Returns:
a new Image based on this prototype

getHeight

public int getHeight()
Exists for testing purposes, not part of the ImageResource interface.


getHTML

public java.lang.String getHTML()
Description copied from interface: ImageResource
Gets an HTML fragment that displays the image represented by this prototype. The HTML returned is not necessarily a simple <img> element. It may be a more complex structure that should be treated opaquely.

Specified by:
getHTML in interface ImageResource
Returns:
the HTML representation of this prototype

getLeft

public int getLeft()
Exists for testing purposes, not part of the ImageResource interface.


getName

public java.lang.String getName()
Description copied from interface: ResourcePrototype
Returns the name of the function within the ResourceBundle used to create the ResourcePrototype.

Specified by:
getName in interface ResourcePrototype
Returns:
the name of the function within the ResourceBundle used to create the ResourcePrototype

getTop

public int getTop()
Exists for testing purposes, not part of the ImageResource interface.


getURL

public java.lang.String getURL()
Exists for testing purposes, not part of the ImageResource interface.


getWidth

public int getWidth()
Exists for testing purposes, not part of the ImageResource interface.