com.google.gwt.gadgets.client.ui
Class GadgetImage

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Image
              extended by com.google.gwt.gadgets.client.ui.GadgetImage
All Implemented Interfaces:
com.google.gwt.event.dom.client.HasAllMouseHandlers, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasErrorHandlers, com.google.gwt.event.dom.client.HasLoadHandlers, com.google.gwt.event.dom.client.HasMouseDownHandlers, com.google.gwt.event.dom.client.HasMouseMoveHandlers, com.google.gwt.event.dom.client.HasMouseOutHandlers, com.google.gwt.event.dom.client.HasMouseOverHandlers, com.google.gwt.event.dom.client.HasMouseUpHandlers, com.google.gwt.event.dom.client.HasMouseWheelHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.SourcesClickEvents, com.google.gwt.user.client.ui.SourcesLoadEvents, com.google.gwt.user.client.ui.SourcesMouseEvents

public class GadgetImage
extends com.google.gwt.user.client.ui.Image

Image that will be cached by the Gadget Container unless this is not executed in a Gadget Container.

The image URL appearing on the browser will not be the one set here but the URL of the cached image on the Gadget container's server.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
GadgetImage()
          Constructs a new GadgetImage.
GadgetImage(java.lang.String url)
          Constructs a new GadgetImage given the image's URL.
GadgetImage(java.lang.String url, int left, int top, int width, int height)
          Creates a clipped image with a specified URL and visibility rectangle.
 
Method Summary
 void setUrl(java.lang.String url)
          Sets the image's URL.
 void setUrlAndVisibleRect(java.lang.String url, int left, int top, int width, int height)
          Sets the url and the visibility rectangle for the image at the same time.
 
Methods inherited from class com.google.gwt.user.client.ui.Image
addClickHandler, addClickListener, addErrorHandler, addLoadHandler, addLoadListener, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, getHeight, getOriginLeft, getOriginTop, getUrl, getWidth, prefetch, removeClickListener, removeLoadListener, removeMouseListener, removeMouseWheelListener, setResource, setVisibleRect, wrap
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

GadgetImage

public GadgetImage()
Constructs a new GadgetImage. This image will be cached on the container.


GadgetImage

public GadgetImage(java.lang.String url)
Constructs a new GadgetImage given the image's URL. This image will be cached by the Gadget container.

Parameters:
url - The URL of the image that will be cached

GadgetImage

public GadgetImage(java.lang.String url,
                   int left,
                   int top,
                   int width,
                   int height)
Creates a clipped image with a specified URL and visibility rectangle. The visibility rectangle is declared relative to the the rectangle which encompasses the entire image, which has an upper-left vertex of (0,0). The load event will be fired immediately after the object has been constructed (i.e. potentially before the image has been loaded in the browser). Since the width and height are specified explicitly by the user, this behavior will not cause problems with retrieving the width and height of a clipped image in a load event handler. This image will be cached by the Gadget container server.

Parameters:
url - the URL of the image to be displayed and that will be cached
left - the horizontal co-ordinate of the upper-left vertex of the visibility rectangle
top - the vertical co-ordinate of the upper-left vertex of the visibility rectangle
width - the width of the visibility rectangle
height - the height of the visibility rectangle
Method Detail

setUrl

public void setUrl(java.lang.String url)
Sets the image's URL. The image will be cached first by the Gadget container.

Overrides:
setUrl in class com.google.gwt.user.client.ui.Image
Parameters:
url - The URL of the image

setUrlAndVisibleRect

public void setUrlAndVisibleRect(java.lang.String url,
                                 int left,
                                 int top,
                                 int width,
                                 int height)
Sets the url and the visibility rectangle for the image at the same time. A single load event will be fired if either the incoming url or visiblity rectangle co-ordinates differ from the image's current url or current visibility rectangle co-ordinates. If the image is currently in the unclipped state, a call to this method will cause a transition to the clipped state. The image will be cached first by the Gadget container.

Overrides:
setUrlAndVisibleRect in class com.google.gwt.user.client.ui.Image
Parameters:
url - the image URL
left - the horizontal coordinate of the upper-left vertex of the visibility rectangle
top - the vertical coordinate of the upper-left vertex of the visibility rectangle
width - the width of the visibility rectangle
height - the height of the visibility rectangle