com.google.gwt.user.client.ui
Class Image

java.lang.Object
  extended bycom.google.gwt.user.client.ui.UIObject
      extended bycom.google.gwt.user.client.ui.Widget
          extended bycom.google.gwt.user.client.ui.Image
All Implemented Interfaces:
EventListener, SourcesClickEvents, SourcesLoadEvents, SourcesMouseEvents

public class Image
extends Widget
implements SourcesClickEvents, SourcesMouseEvents, SourcesLoadEvents

A widget that displays the image at a given URL.

CSS Style Rules

Example

code


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
Image()
          Creates an empty image.
Image(String url)
          Creates an image with a specified URL.
 
Method Summary
 void addClickListener(ClickListener listener)
          Adds a listener interface to receive click events.
 void addLoadListener(LoadListener listener)
          Adds a listener interface to receive load events.
 void addMouseListener(MouseListener listener)
          Adds a listener interface to receive mouse events.
 String getUrl()
          Gets the URL of the image.
 void onBrowserEvent(Event event)
          Fired whenever a browser event is received.
static void prefetch(String url)
          Causes the browser to pre-fetch the image at a given URL.
 void removeClickListener(ClickListener listener)
          Removes a previously added listener interface.
 void removeLoadListener(LoadListener listener)
          Removes a previously added listener interface.
 void removeMouseListener(MouseListener listener)
          Removes a previously added listener interface.
 void setUrl(String url)
          Sets the URL of the image to be displayed.
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onAttach, onDetach, onLoad
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode
 

Constructor Detail

Image

public Image()
Creates an empty image.


Image

public Image(String url)
Creates an image with a specified URL.

Parameters:
url - the URL of the image to be displayed
Method Detail

prefetch

public static void prefetch(String url)
Causes the browser to pre-fetch the image at a given URL.

Parameters:
url - the URL of the image to be prefetched

addClickListener

public void addClickListener(ClickListener listener)
Description copied from interface: SourcesClickEvents
Adds a listener interface to receive click events.

Specified by:
addClickListener in interface SourcesClickEvents
Parameters:
listener - the listener interface to add

addLoadListener

public void addLoadListener(LoadListener listener)
Description copied from interface: SourcesLoadEvents
Adds a listener interface to receive load events.

Specified by:
addLoadListener in interface SourcesLoadEvents
Parameters:
listener - the listener interface to add

addMouseListener

public void addMouseListener(MouseListener listener)
Description copied from interface: SourcesMouseEvents
Adds a listener interface to receive mouse events.

Specified by:
addMouseListener in interface SourcesMouseEvents
Parameters:
listener - the listener interface to add

getUrl

public String getUrl()
Gets the URL of the image.

Returns:
the image URL

onBrowserEvent

public void onBrowserEvent(Event event)
Description copied from interface: EventListener
Fired whenever a browser event is received.

Specified by:
onBrowserEvent in interface EventListener
Overrides:
onBrowserEvent in class Widget

removeClickListener

public void removeClickListener(ClickListener listener)
Description copied from interface: SourcesClickEvents
Removes a previously added listener interface.

Specified by:
removeClickListener in interface SourcesClickEvents
Parameters:
listener - the listener interface to remove

removeLoadListener

public void removeLoadListener(LoadListener listener)
Description copied from interface: SourcesLoadEvents
Removes a previously added listener interface.

Specified by:
removeLoadListener in interface SourcesLoadEvents
Parameters:
listener - the listener interface to remove

removeMouseListener

public void removeMouseListener(MouseListener listener)
Description copied from interface: SourcesMouseEvents
Removes a previously added listener interface.

Specified by:
removeMouseListener in interface SourcesMouseEvents
Parameters:
listener - the listener interface to remove

setUrl

public void setUrl(String url)
Sets the URL of the image to be displayed.

Parameters:
url - the image URL


This javadoc distribution was not produced by Google. The official documentation is here.