Class Signature

All Implemented Interfaces:
Serializable, Cloneable, Component, Scope, ComponentCtrl

public class Signature extends 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:
  • Field Details

  • Constructor Details

    • Signature

      public Signature()
  • Method Details

    • isChildable

      protected boolean isChildable()
      Description copied from class: AbstractComponent
      Returns whether this component can have a child.

      Default: return true (means it can have children).

      Overrides:
      isChildable in class 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

      public String getPenColor()
      Returns the pen color of the signature pad.

      Default: black.

      Returns:
      pen color of the signature pad.
    • setPenColor

      public void setPenColor(String penColor)
      Sets the pen color of the signature pad.
      Parameters:
      penColor - the pen color for signature pad.
    • getBackgroundColor

      public String getBackgroundColor()
      Returns the background color of the signature pad.

      Default: white.

      Returns:
      the background color of the signature pad.
    • setBackgroundColor

      public void setBackgroundColor(String backgroundColor)
      Sets the background color for the signature pad.
      Parameters:
      backgroundColor - the background color for signature pad.
    • getBackgroundImage

      public String getBackgroundImage()
      Returns the background image URI of signature pad.

      Default: null.

      Returns:
      the background image URI of signature pad.
      Since:
      9.6.0
    • setBackgroundImage

      public void setBackgroundImage(String backgroundImage)
      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

      public String 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

      public void setSaveType(String saveType)
      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

      public String getUndoLabel()
      Returns the label on undo button. Default: null.
      Returns:
      the label on undo button.
    • setUndoLabel

      public void setUndoLabel(String undoLabel)
      Sets the label on undo button.
      Parameters:
      undoLabel - the label on undo button.
    • getSaveLabel

      public String getSaveLabel()
      Returns the label on save button. Default: null.
      Returns:
      the label on save button.
    • setSaveLabel

      public void setSaveLabel(String saveLabel)
      Sets the label on save button.
      Parameters:
      saveLabel - the label on undo button.
    • getClearLabel

      public String getClearLabel()
      Returns the label on clear button. Default: null.
      Returns:
      the label on clear button.
    • setClearLabel

      public void setClearLabel(String clearLabel)
      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 to getSaveType().
    • service

      public void service(AuRequest request, boolean everError)
      Description copied from class: HtmlBasedComponent
      Processes an AU request.

      Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.

      Specified by:
      service in interface ComponentCtrl
      Overrides:
      service in class HtmlBasedComponent
      everError - whether any error ever occurred before processing this request.
      See Also:
    • renderProperties

      protected void renderProperties(ContentRenderer renderer) throws IOException
      Description copied from class: HtmlBasedComponent
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
      renderProperties in class XulElement
      Throws:
      IOException