|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Image
public class Image
An image.
See also how to fix the alpha transparency problem of PNG files found in IE6?
Nested Class Summary | |
---|---|
protected class |
Image.ExtraCtrl
A utility class to implement AbstractComponent.getExtraCtrl() . |
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
AbstractComponent.Children |
Field Summary |
---|
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
_height, _left, _top, _width, _zclass |
Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
_visible |
Fields inherited from interface org.zkoss.zk.ui.Component |
---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl |
---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
Constructor Summary | |
---|---|
Image()
|
|
Image(java.lang.String src)
|
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. |
protected boolean |
isChildable()
Default: not childable. |
protected java.lang.Object |
newExtraCtrl()
Used by AbstractComponent.getExtraCtrl() to create a client control. |
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing tags and children. |
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 class org.zkoss.zul.impl.XulElement |
---|
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
focus, getDraggable, getDroppable, getHeight, getHflex, getLeft, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, service, setClass, setDraggable, setDroppable, setFocus, setHeight, setHflex, setLeft, setSclass, setStyle, setTooltiptext, setTop, setVflex, setWidth, setZclass, setZindex, setZIndex |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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.ext.Scope |
---|
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute |
Constructor Detail |
---|
public Image()
public Image(java.lang.String src)
Method Detail |
---|
public java.lang.String getAlign()
Default: null (use browser default).
getAlign
in interface Image
public void setAlign(java.lang.String align)
setAlign
in interface Image
public java.lang.String getBorder()
Default: null (use browser default).
getBorder
in interface Image
public void setBorder(java.lang.String border)
setBorder
in interface Image
public java.lang.String getHspace()
Default: null (use browser default).
getHspace
in interface Image
public void setHspace(java.lang.String hspace)
setHspace
in interface Image
public java.lang.String getVspace()
Default: null (use browser default).
getVspace
in interface Image
public void setVspace(java.lang.String vspace)
setVspace
in interface Image
public java.lang.String getSrc()
Default: null.
getSrc
in interface Image
public void setSrc(java.lang.String src)
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.
setSrc
in interface Image
src
- the URI of the image sourcesetContent(org.zkoss.image.Image)
,
setContent(RenderedImage)
public void setContent(Image image)
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.
setContent
in interface Image
image
- the image to display.setSrc(java.lang.String)
public void setContent(java.awt.image.RenderedImage 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.
setContent
in interface Image
public Image getContent()
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)
.
getContent
in interface Image
public java.lang.String getHover()
Default: null.
getHover
in interface Image
public void setHover(java.lang.String src)
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.
setHover
in interface Image
setHoverContent(org.zkoss.image.Image)
,
setHoverContent(RenderedImage)
public void setHoverContent(Image image)
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.
setHoverContent
in interface Image
image
- the image to display.setHover(java.lang.String)
public void setHoverContent(java.awt.image.RenderedImage 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 setHoverContent(org.zkoss.image.Image)
.
If you want more control such as different format, quality,
and naming, you can use Images
directly.
setHoverContent
in interface Image
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
See also Render Special Properties
renderProperties
in class XulElement
java.io.IOException
protected boolean isChildable()
isChildable
in class AbstractComponent
protected java.lang.Object newExtraCtrl()
HtmlBasedComponent
AbstractComponent.getExtraCtrl()
to create a client control.
It is used only by component developers.
Defaut: creates an instance of HtmlBasedComponent.ExtraCtrl
.
newExtraCtrl
in class HtmlBasedComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |