Package org.zkoss.zkmax.zul
Class Signature
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zkmax.zul.Signature
- All Implemented Interfaces:
Serializable,Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
public class Signature
extends org.zkoss.zul.impl.XulElement
A signature pad for user to sign a signature on it with save, undo, clear method.
- Since:
- 8.6.0
- Author:
- klyve, charles
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo -
Field Summary
FieldsFields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the signature.Returns the background color of the signature pad.Returns the background image URI of signature pad.Returns the label on clear button.Returns the pen color of the signature pad.intReturns the pen size of the signature pad.Returns the label on save button.Returns the type for saving signature image.Returns the label on undo button.booleanReturns whether the background color and image are included while saved.protected booleanbooleanReturns the visibility of the toolbar for signature pad.protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) voidsave()Save the Signature.voidservice(org.zkoss.zk.au.AuRequest request, boolean everError) voidsetBackgroundColor(String backgroundColor) Sets the background color for the signature pad.voidsetBackgroundImage(String backgroundImage) Sets the background image URI for the signature pad.voidsetBackgroundIncluded(boolean backgroundIncluded) Sets whether the background color and image are included while saved.voidsetClearLabel(String clearLabel) Sets the label on clear button.voidsetPenColor(String penColor) Sets the pen color of the signature pad.voidsetPenSize(int penSize) Sets the pen size of the signature pad.voidsetSaveLabel(String saveLabel) Sets the label on save button.voidsetSaveType(String saveType) Sets the type for saving signature image.voidsetToolbarVisible(boolean toolbarVisible) Sets the visibility of the toolbar for signature pad.voidsetUndoLabel(String undoLabel) Sets the label on undo button.voidundo()Undo the signature.Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setSkeleton, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
Field Details
-
ON_SAVE
- See Also:
-
ON_CLEAR
- See Also:
-
-
Constructor Details
-
Signature
public Signature()
-
-
Method Details
-
isChildable
protected boolean isChildable()- Overrides:
isChildablein classorg.zkoss.zk.ui.AbstractComponent
-
getPenSize
public int getPenSize()Returns the pen size of the signature pad.Default: 1.
- Returns:
- pen size of the signature pad.
-
setPenSize
public void setPenSize(int penSize) Sets the pen size of the signature pad.- Parameters:
penSize- the pen size for signature pad.
-
getPenColor
Returns the pen color of the signature pad.Default: black.
- Returns:
- pen color of the signature pad.
-
setPenColor
Sets the pen color of the signature pad.- Parameters:
penColor- the pen color for signature pad.
-
getBackgroundColor
Returns the background color of the signature pad.Default: white.
- Returns:
- the background color of the signature pad.
-
setBackgroundColor
Sets the background color for the signature pad.- Parameters:
backgroundColor- the background color for signature pad.
-
getBackgroundImage
Returns the background image URI of signature pad.Default: null.
- Returns:
- the background image URI of signature pad.
- Since:
- 9.6.0
-
setBackgroundImage
Sets the background image URI for the signature pad. Notice that the background image will cover the background color.- Parameters:
backgroundImage- the background image URI of signature pad.- Since:
- 9.6.0
-
isBackgroundIncluded
public boolean isBackgroundIncluded()Returns whether the background color and image are included while saved.Default: true.
- Returns:
- whether the background color and image are included while saved.
- Since:
- 9.6.0
-
setBackgroundIncluded
public void setBackgroundIncluded(boolean backgroundIncluded) Sets whether the background color and image are included while saved.- Parameters:
backgroundIncluded- whether the background color and image are included while saved.- Since:
- 9.6.0
-
isToolbarVisible
public boolean isToolbarVisible()Returns the visibility of the toolbar for signature pad.Default: true.
- Returns:
- the visibility of the toolbar.
-
setToolbarVisible
public void setToolbarVisible(boolean toolbarVisible) Sets the visibility of the toolbar for signature pad.- Parameters:
toolbarVisible- the visibility of the toolbar.
-
getSaveType
Returns the type for saving signature image. The supported type is MIME type, e.g., image/png, image/jpeg. If the requested type is invalid or unspecified, it will use image/png. Default: image/png.- Returns:
- type for saving signature image.
-
setSaveType
Sets the type for saving signature image. The supported type is MIME type, e.g., image/png, image/jpeg. If the requested type is invalid or unspecified, it will use image/png.- Parameters:
saveType- type for saving signature image.
-
getUndoLabel
Returns the label on undo button. Default: null.- Returns:
- the label on undo button.
-
setUndoLabel
Sets the label on undo button.- Parameters:
undoLabel- the label on undo button.
-
getSaveLabel
Returns the label on save button. Default: null.- Returns:
- the label on save button.
-
setSaveLabel
Sets the label on save button.- Parameters:
saveLabel- the label on undo button.
-
getClearLabel
Returns the label on clear button. Default: null.- Returns:
- the label on clear button.
-
setClearLabel
Sets the label on clear button.- Parameters:
clearLabel- the label on clear button.
-
undo
public void undo()Undo the signature. -
clear
public void clear()Clear the signature. -
save
public void save()Save the Signature. It will upload a file and fire an onSave event to server, upload file type is according togetSaveType(). -
service
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) - Specified by:
servicein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
servicein classorg.zkoss.zk.ui.HtmlBasedComponent
-
renderProperties
- Overrides:
renderPropertiesin classorg.zkoss.zul.impl.XulElement- Throws:
IOException
-