|
||||||||||
| 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
org.zkoss.zul.Captcha
public class Captcha
The generic captcha component.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zul.Image |
|---|
Image.ExtraCtrl |
| 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 | |
|---|---|
Captcha()
|
|
| Method Summary | |
|---|---|
void |
addFont(java.awt.Font font)
Add fonts into fonts list. |
java.lang.String |
getBgColor()
Get the background color of the captcha box (in string as #RRGGBB). |
int |
getBgRGB()
Get the background color in int array (0: red, 1: green, 2:blue). |
CaptchaEngine |
getCaptchaEngine()
Get the captcha engine. |
java.awt.Font[] |
getDefaultFonts()
Gets the default font list. |
java.lang.String |
getExclude()
Get exclude characters. |
java.awt.Font |
getFont(int j)
Get nth Font. |
java.lang.String |
getFontColor()
Gets font color. |
int |
getFontRGB()
Get the font color in int array (0: red, 1: green, 2:blue). |
java.util.List |
getFonts()
Gets fonts list, default provide two fonts. |
int |
getIntHeight()
Get the captcha int height in pixel; to be used by the derived subclass. |
int |
getIntWidth()
Get the captcha int width in pixel; to be used by the derived subclass. |
int |
getLength()
Get length of the autogenerated text value; default to 5. |
java.lang.String |
getValue()
Get the text value of this captcha. |
boolean |
isNoise()
Whether generate noise; default to true. |
java.lang.String |
randomValue()
Regenerates new captcha text value and redraw. |
void |
setBgColor(java.lang.String color)
Set the background color of the chart. |
void |
setEngine(CaptchaEngine engine)
Set the captcha engine. |
void |
setEngine(java.lang.String clsnm)
Sets the captcha engine by use of a class name. |
void |
setExclude(java.lang.String exclude)
Set exclude characters that will not be generated. |
void |
setFontColor(java.lang.String color)
Set font color. |
void |
setHeight(java.lang.String h)
Override super class to prepare the int height. |
void |
setLength(int len)
Set length of the autogenerated text value; default to 5. |
void |
setNoise(boolean b)
Wheather generate noise; default to true. |
void |
setValue(java.lang.String text)
Set the text value to be shown as the distortion captcha. |
void |
setWidth(java.lang.String w)
Override super class to prepare the int width. |
protected void |
smartDrawCaptcha()
mark a draw flag to inform that this Chart needs update. |
| Methods inherited from class org.zkoss.zul.Image |
|---|
getAlign, getBorder, getContent, getHspace, getInnerAttrs, getOuterAttrs, getSrc, getVspace, isChildable, newExtraCtrl, setAlign, setBorder, setContent, setHspace, setSrc, setVspace, smartUpdate |
| 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, setLeft, setSclass, setStyle, setTooltiptext, setTop, 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 |
|---|
public Captcha()
| Method Detail |
|---|
public java.util.List getFonts()
public java.awt.Font[] getDefaultFonts()
public java.awt.Font getFont(int j)
public void addFont(java.awt.Font font)
public void setFontColor(java.lang.String color)
public java.lang.String getFontColor()
public int getFontRGB()
public void setBgColor(java.lang.String color)
color - in #RRGGBB format (hexdecimal).public java.lang.String getBgColor()
public int getBgRGB()
public void setWidth(java.lang.String w)
setWidth in class org.zkoss.zk.ui.HtmlBasedComponentpublic int getIntWidth()
public void setHeight(java.lang.String h)
setHeight in class org.zkoss.zk.ui.HtmlBasedComponentpublic int getIntHeight()
public java.lang.String getValue()
public void setValue(java.lang.String text)
text - the captcha text valuepublic void setLength(int len)
public int getLength()
public void setExclude(java.lang.String exclude)
public java.lang.String getExclude()
public void setNoise(boolean b)
public boolean isNoise()
public java.lang.String randomValue()
public void setEngine(java.lang.String clsnm)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.InstantiationException,
java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetExceptionpublic void setEngine(CaptchaEngine engine)
public CaptchaEngine getCaptchaEngine()
protected void smartDrawCaptcha()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||