org.zkoss.zul.api
Interface Image

All Superinterfaces:
java.lang.Cloneable, Component, HtmlBasedComponent, Scope, java.io.Serializable, XulElement
All Known Subinterfaces:
Captcha, Chart, Imagemap
All Known Implementing Classes:
Captcha, Chart, Image, Imagemap

public interface Image
extends XulElement

An image.

Note: IE 5.5/6 (not 7) has a bug that failed to render PNG with alpha transparency. See http://homepage.ntlworld.com/bobosola/index.htm for details. Thus, if you want to display such image, you have to use the alphafix mold.

Since:
3.5.2
Author:
tomyeh

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 java.lang.String getAlign()
          Returns the alignment.
 java.lang.String getBorder()
          Returns the width of the border.
 Image getContent()
          Returns the content set by setContent(org.zkoss.image.Image).
 java.lang.String getHover()
          Returns the URI of the hover image.
 java.lang.String getHspace()
          Returns number of pixels of extra space to the left and right side of the image.
 java.lang.String getSrc()
          Returns the source URI of the image.
 java.lang.String getVspace()
          Returns number of pixels of extra space to the top and bottom side of the image.
 void setAlign(java.lang.String align)
          Sets the alignment: one of top, texttop, middle, absmiddle, bottom, absbottom, baseline, left, right and center.
 void setBorder(java.lang.String border)
          Sets the width of the border.
 void setContent(Image image)
          Sets the content directly.
 void setContent(java.awt.image.RenderedImage image)
          Sets the content directly with the rendered image.
 void setHover(java.lang.String src)
          Sets the image URI.
 void setHoverContent(Image image)
          Sets the content of the hover image directly.
 void setHoverContent(java.awt.image.RenderedImage image)
          Sets the content of the hover image directly with the rendered image.
 void setHspace(java.lang.String hspace)
          Sets number of pixels of extra space to the left and right side of the image.
 void setSrc(java.lang.String src)
          Sets the source URI of the image.
 void setVspace(java.lang.String vspace)
          Sets number of pixels of extra space to the top and bottom side of the image.
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

getAlign

java.lang.String getAlign()
Returns the alignment.

Default: null (use browser default).


setAlign

void setAlign(java.lang.String align)
Sets the alignment: one of top, texttop, middle, absmiddle, bottom, absbottom, baseline, left, right and center.


getBorder

java.lang.String getBorder()
Returns the width of the border.

Default: null (use browser default).


setBorder

void setBorder(java.lang.String border)
Sets the width of the border.


getHspace

java.lang.String getHspace()
Returns number of pixels of extra space to the left and right side of the image.

Default: null (use browser default).


setHspace

void setHspace(java.lang.String hspace)
Sets number of pixels of extra space to the left and right side of the image.


getVspace

java.lang.String getVspace()
Returns number of pixels of extra space to the top and bottom side of the image.

Default: null (use browser default).


setVspace

void setVspace(java.lang.String vspace)
Sets number of pixels of extra space to the top and bottom side of the image.


getSrc

java.lang.String getSrc()
Returns the source URI of the image.

Default: null.


setSrc

void setSrc(java.lang.String src)
Sets the source URI of the image.

Calling this method implies setContent(null). In other words, the last invocation of setSrc(java.lang.String) overrides the previous setContent(org.zkoss.image.Image), if any.

Parameters:
src - the URI of the image source
See Also:
setContent(org.zkoss.image.Image), setContent(RenderedImage)

setContent

void setContent(Image image)
Sets the content directly.

Default: null.

Calling this method implies setSrc(null). In other words, the last invocation of setContent(org.zkoss.image.Image) overrides the previous setSrc(java.lang.String), if any.

Parameters:
image - the image to display.
See Also:
setSrc(java.lang.String)

setContent

void setContent(java.awt.image.RenderedImage image)
Sets the content directly with the rendered image. It actually encodes the rendered image to an PNG image (Image) with Images.encode(java.lang.String, java.awt.image.RenderedImage, float, boolean), and then invoke setContent(org.zkoss.image.Image).

If you want more control such as different format, quality, and naming, you can use Images directly.


getContent

Image getContent()
Returns the content set by setContent(org.zkoss.image.Image).

Note: it won't fetch what is set thru by setSrc(java.lang.String). It simply returns what is passed to setContent(org.zkoss.image.Image).


getHover

java.lang.String getHover()
Returns the URI of the hover image. The hover image is used when the mouse is moving over this component.

Default: null.


setHover

void setHover(java.lang.String src)
Sets the image URI. The hover image is used when the mouse is moving over this component.

Calling this method implies setHoverContent(null). In other words, the last invocation of setHover(java.lang.String) overrides the previous setHoverContent(org.zkoss.image.Image), if any.

See Also:
setHoverContent(org.zkoss.image.Image), setHoverContent(RenderedImage)

setHoverContent

void setHoverContent(Image image)
Sets the content of the hover image directly. The hover image is used when the mouse is moving over this component.

Default: null.

Calling this method implies setHover(null). In other words, the last invocation of setHoverContent(org.zkoss.image.Image) overrides the previous setHover(java.lang.String), if any.

Parameters:
image - the image to display.
See Also:
setHover(java.lang.String)

setHoverContent

void setHoverContent(java.awt.image.RenderedImage image)
Sets the content of the hover image directly with the rendered image. The hover image is used when the mouse is moving over this component.

It actually encodes the rendered image to an PNG image ( Image) with Images.encode(java.lang.String, java.awt.image.RenderedImage, float, boolean), and then invoke setHoverContent(org.zkoss.image.Image).

If you want more control such as different format, quality, and naming, you can use Images directly.



Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo