Skip to content
UI5 Library for Signature
JavaScript HTML CSS
Branch: master
Clone or download
kvsrikanthj Merge pull request #3 from Michadelic/master
Removed 1 level in base path to correct sample path
Latest commit f218ed6 Nov 2, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist Removed 1 level in base path to correct sample path Nov 2, 2018
src/ui5/sign Lowercase jquery.sap.global dependency Oct 30, 2018
test
.eslintignore Initial Commit Oct 19, 2018
.eslintrc Initial Commit Oct 19, 2018
.gitignore Include dist folder Oct 19, 2018
Gruntfile.js
README.md
bower.json
package-lock.json
package.json

README.md

UI5 - library - Signature control

Version: 1.0.0

Overview

SAP UI5 custom control for Signature in SVG using d3. Supports both mouse and touch events.
This control extends sap.ui.core.Control

Tested with Open UI5 version 1.58.3 which internally uses d3 version 3.4.12

Constructor

Creates and initializes a new control with the given sId and settings.

new ui5.sign.Signature(sId?, mSettings?)

Control Properties

Name Type Default value Description
height sap.ui.core.CSSSize 100% Defines height of control
width sap.ui.core.CSSSize 100% Defines width of control
backgroundColor sap.ui.core.CSSColor rgb(221, 221, 221) Defines background color for the control
penColor sap.ui.core.CSSColor black Defines color of pen to draw signature
penSize int 2 Size of pen for drawing.
Note: Throws error when value is set less than 1.
editable boolean true Defines whether the control can be modified by the user or not.

Control API

Summary

Method Description
clear Clears SVG content of the control
getBackgroundColor Gets current value of property backgroundColor
getEditable Gets current value of property editable
getHeight Gets current value of property height
getPenColor Gets current value of property penColor
getPenSize Gets current value of property penSize
getSVGString Returns SVG as string
getWidth Gets current value of property width
setBackgroundColor Sets new value for property backgroundColor
setEditable Sets new value for property editable
setHeight Sets new value for property height
setPenColor Sets new value for property penColor
setPenSize Sets new value for property penSize
setSVGString Provided SVG string input is rendered onto the screen
Also set's property editable to false which makes the control not editable for input
setWidth Sets new value for property width

clear

Clears SVG content of the control.
Visibility: public

clear() : ui5.sign.Signature
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining

getBackgroundColor

Gets current value of property backgroundColor
Defines background color of control
Visibility: public

getBackgroundColor() : sap.ui.core.CSSColor
Returns Description
sap.ui.core.CSSColor Value of property backgroundColor

getEditable

Gets current value of property editable
Defines whether the control can be modified by the user or not
Visibility: public

getEditable() : boolean
Returns Description
boolean Value of property editable

getHeight

Gets current value of property height
Defines height of control
Visibility: public

getHeight() : sap.ui.core.CSSSize
Returns Description
sap.ui.core.CSSSize Value of property height

getPenColor

Gets current value of property penColor
Defines pen color of control used to draw signature
Visibility: public

getPenColor() : sap.ui.core.CSSColor
Returns Description
sap.ui.core.CSSColor Value of property penColor

getPenSize

Gets current value of property penSize
Defines pen size of control
Visibility: public

getPenSize() : sap.ui.core.CSSSize
Returns Description
sap.ui.core.CSSSize Value of property penSize

getSVGString

Gets SVG content of the control as string
Visibility: public

getSVGString() : string
Returns Description
string SVG value

getWidth

Gets current value of property width
Defines width of control
Visibility: public

getWidth() : sap.ui.core.CSSSize
Returns Description
sap.ui.core.CSSSize Value of property width

setBackgroundColor

Sets new value for property backgroundColor
Visibility: public

setBackgroundColor(sColor) : ui5.sign.Signature
Param Type Description
sColor sap.ui.core.CSSColor New value for property backgroundColor
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining

setEditable

Sets new value for property editable
Visibility: public

setEditable(bEditable) : ui5.sign.Signature
Param Type Description
bEditable boolean New value for property editable
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining

setHeight

Sets new value for property height
Visibility: public

setHeight(sHeight) : sap.ui.core.CSSSize
Param Type Description
sHeight sap.ui.core.CSSSize New value for property height
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining

setPenColor

Sets new value for property penColor
Visibility: public

setPenColor(sColor) : ui5.sign.Signature
Param Type Description
sColor sap.ui.core.CSSColor New value for property penColor
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining

setPenSize

Sets new value for property penSize
Throws error if set value is less than 1
Visibility: public

setPenSize(nSize) : int
Param Type Description
nSize int New value for property penSize
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining

setSVGString

Provided SVG string input is rendered onto the screen
Also set's property editable to false which makes the control not editable for input
Visibility: public

setSVGString(sSVGString) : ui5.sign.Signature
Param Type Description
sSVGString string SVG as string
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining

setWidth

Sets new value for property width
Visibility: public

setWidth(sWidth) : ui5.sign.Signature
Param Type Description
sWidth sap.ui.core.CSSSize New value for property width
Returns Description
ui5.sign.Signature Reference to this in order to allow method chaining
You can’t perform that action at this time.