org.zkoss.zul
Class Image

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Image
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl
Direct Known Subclasses:
Captcha, Imagemap

public class 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. <image mold="alphafix"/>

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class Image.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
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.
 org.zkoss.image.Image getContent()
          Returns the content set by setContent(org.zkoss.image.Image).
 java.lang.String getHspace()
          Returns number of pixels of extra space to the left and right side of the image.
 java.lang.String getInnerAttrs()
          Generates the Client-Side-Action attributes to the interior tag.
 java.lang.String getOuterAttrs()
           
 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.
 boolean isChildable()
          Default: not childable.
protected  java.lang.Object newExtraCtrl()
           
 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(org.zkoss.image.Image image)
          Sets the content directly.
 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.
 void smartUpdate(java.lang.String attr, java.lang.String value)
           
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Image

public Image()

Image

public Image(java.lang.String src)
Method Detail

getAlign

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

Default: null (use browser default).


setAlign

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


getBorder

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

Default: null (use browser default).


setBorder

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


getHspace

public 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

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


getVspace

public 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

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


getSrc

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

Default: null.


setSrc

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

If setContent(org.zkoss.image.Image) is ever called with non-null, it takes heigher priority than this method.

Parameters:
src - the URI of the image source

setContent

public void setContent(org.zkoss.image.Image image)
Sets the content directly. Default: null.

Parameters:
image - the image to display. If not null, it has higher priority than getSrc().

getContent

public org.zkoss.image.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).


getOuterAttrs

public java.lang.String getOuterAttrs()
Overrides:
getOuterAttrs in class XulElement

getInnerAttrs

public java.lang.String getInnerAttrs()
Description copied from class: XulElement
Generates the Client-Side-Action attributes to the interior tag. Reason: onfocus is the main use.

Overrides:
getInnerAttrs in class XulElement

isChildable

public boolean isChildable()
Default: not childable.

Specified by:
isChildable in interface org.zkoss.zk.ui.Component
Overrides:
isChildable in class org.zkoss.zk.ui.AbstractComponent

smartUpdate

public void smartUpdate(java.lang.String attr,
                        java.lang.String value)
Specified by:
smartUpdate in interface org.zkoss.zk.ui.Component
Overrides:
smartUpdate in class org.zkoss.zk.ui.AbstractComponent

newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class org.zkoss.zk.ui.HtmlBasedComponent


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.