|
||||||||||
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.
[Since 6.0.0]
To turn on the preload image function for this component, you have to specify the component's attribute map with key "org.zkoss.zul.image.preload" to true. That is, for example, if in a zul file, you shall specify <custom-attributes> of the component like this:
<image ...>
<custom-attributes org.zkoss.zul.image.preload='true'/>
</image>
Or specify it onto the root component.
For example,
<window ...>
<custom-attributes org.zkoss.zul.image.preload="true"/>
<image .../>
</window>
[Since 6.5.2]
Preload image function is also configurable from zk.xml by setting library properties. For example,
<library-property/>
<name>org.zkoss.zul.image.preload</name/>
<value>true</value/>
</library-property/>
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 HtmlBasedComponent.getExtraCtrl() . |
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
org.zkoss.zk.ui.AbstractComponent.Children |
Field Summary |
---|
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
_zclass |
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(String src)
|
Method Summary | |
---|---|
String |
getAlign()
Deprecated. as of release 6.0.0, use CSS instead. |
String |
getBorder()
Deprecated. As of release 5.0.5, use CSS instead. |
org.zkoss.image.Image |
getContent()
Returns the content set by setContent(org.zkoss.image.Image) . |
Object |
getExtraCtrl()
|
String |
getHover()
Returns the URI of the hover image. |
String |
getHspace()
Deprecated. as of release 6.0.0, use CSS instead. |
String |
getSrc()
Returns the source URI of the image. |
String |
getVspace()
Deprecated. as of release 6.0.0, use CSS instead. |
protected boolean |
isChildable()
Default: not childable. |
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
|
void |
setAlign(String align)
Deprecated. as of release 6.0.0, use CSS instead. |
void |
setBorder(String border)
Deprecated. As of release 5.0.5, use CSS instead. |
void |
setContent(org.zkoss.image.Image image)
Sets the content directly. |
void |
setContent(RenderedImage image)
Sets the content directly with the rendered image. |
void |
setHover(String src)
Sets the image URI. |
void |
setHoverContent(org.zkoss.image.Image image)
Sets the content of the hover image directly. |
void |
setHoverContent(RenderedImage image)
Sets the content of the hover image directly with the rendered image. |
void |
setHspace(String hspace)
Deprecated. as of release 6.0.0, use CSS instead. |
void |
setSrc(String src)
Sets the source URI of the image. |
void |
setVspace(String vspace)
Deprecated. as of release 6.0.0, use CSS instead. |
Methods inherited from class org.zkoss.zul.impl.XulElement |
---|
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly |
Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Image()
public Image(String src)
Method Detail |
---|
public String getAlign()
Default: null (use browser default).
public void setAlign(String align)
public String getBorder()
public void setBorder(String border)
public String getHspace()
Default: null (use browser default).
public void setHspace(String hspace)
public String getVspace()
Default: null (use browser default).
public void setVspace(String vspace)
public String getSrc()
Default: null.
public void setSrc(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.
src
- the URI of the image sourcesetContent(org.zkoss.image.Image)
,
setContent(RenderedImage)
public void setContent(org.zkoss.image.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.
image
- the image to display.setSrc(java.lang.String)
public void setContent(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.
public org.zkoss.image.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)
.
public String getHover()
Default: null.
public void setHover(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.
setHoverContent(org.zkoss.image.Image)
,
setHoverContent(RenderedImage)
public void setHoverContent(org.zkoss.image.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.
image
- the image to display.setHover(java.lang.String)
public void setHoverContent(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.
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class XulElement
IOException
protected boolean isChildable()
isChildable
in class org.zkoss.zk.ui.AbstractComponent
public Object getExtraCtrl()
getExtraCtrl
in interface org.zkoss.zk.ui.sys.ComponentCtrl
getExtraCtrl
in class org.zkoss.zk.ui.HtmlBasedComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |