Skip to main content

WizCtl

WizCtl

This class extends java.awt.Canvas to reproduce the LCD display and provides the java interface to the COM control.

Full qualification: com.florentis.signature.WizCtl

Summary

Method
padConnect
padDisconnect
reset
addObject
addPrimitive
getObjectState
setFont
setEventHandler
display
fireClick
processEvents
endProcessEvents
close
Property
inkingPad
enableWizardDisplay
padWidth
padHeight
zoom
licence
Enumerations
ObjectType
PrimitiveType
AlignmentType
CheckboxOptions
PrimitiveOptions
EventType
InputOptions
EncryptionAlg

Methods

padConnect

Connects to the signature tablet / pad.

public native boolean padConnect()
Parameters
None
Return Value
boolean
0 Success
<>0 Failed to connect

padDisconnect

Disconnects the signature tablet / pad.

public native void padDisconnect()
Parameters
None
Return Value
None

reset

Disables events, removes all internal controls and prepares for setting the display. Does not change the current display.

public native void reset()
Parameters
None
Return Value
None

addObject

Adds an item to the pad control list.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectType enum value specifying the object type
idString specifying an identifier for the object
x, yPosition of the top left corner of the object on the pad display. Value can be absolute pixels or strings:

X: "left", "right", "centre"
Y: "top", "middle", "bottom"
dataData dependent on the object type
optionsValue dependent on object type
Return Value
None

addObject (ObjectText)

Displays a text string on the pad using the current font.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectText
idSpecial values when used with a signature object:
  • "who" — Text in data used as signatory name
  • "why" — Text in data used as reason for signing
  • "when" — Reserved for future use (nullable or empty allowed)
x, yPosition of top left corner; absolute pixels or strings:
X: "left", "right", "centre"; Y: "top", "middle", "bottom"
dataText to display
optionsValue from the TextOptions Enumerator (optional)
Return Value
None

addObject (ObjectButton)

Creates a button – text surrounded by a rectangle which generates a click event when tapped with the pen. Text is displayed in the current font.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectButton
idThe following values have special meanings when used with signature or input objects:
  • "OK" — Accepts current input.
    With a signature, stores the captured signature in the signature object and terminates input. Until a signature has been captured, the button is disabled by the Wizard Control.
    With an Input object, the button is disabled until the required minimum number of characters has been entered.
  • "Clear" — Clears current input allowing user to start again.
    With a signature, clears any captured 'ink' from the display.
    With an Input object, clears all entered input.
  • "Cancel" — With a signature, clears any captured 'ink' and terminates input
  • "Delete" — With an input object, deletes the last character
x, yTop left corner of the object; absolute pixels or strings:
X: "left", "right", "centre"
Y: "top", "middle", "bottom"
dataText to display
optionsEither, an integer specifying button width in pixels or an ObjectOptions object. If the given width is less than the width of the text (in the current font), it is ignored. (Optional)
Return Value
None

addObject (ObjectCheckbox)

Creates a checkbox – a small rectangle followed by text which toggles its state and generates an event when tapped with the pen. Text is displayed in the current font.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectCheckbox
idCannot be any reserved text or button values: who, why, OK, Clear, Cancel
x, yTop left corner of object; value can either be absolute position in pixels, or one of the strings:
X: "left", "right", "centre"
Y: "top", "middle", "bottom"
dataText to display
optionsCheckboxOptions enum values (optional)
Return Value
None

addObject (ObjectRadioButton)

Creates a radio button – a small circle followed by text. Radio buttons are used in groups where tapping one selects it and deselects the others. Tapping with the pen also generates an event. Text is displayed in the current font.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectCheckbox
idCannot be reserved button IDs: who, why, OK, Clear, Cancel
x, yTop left corner; absolute pixels or:
X: "left", "right", "centre"
Y: "top", "middle", "bottom"
dataText to display
optionsObjectOptions for group name and selection state
Return Value
None

addObject (ObjectSignature)

Puts the pad into signature capture mode and specifies a signature object or control in which a captured signature is saved. It is an error to add more than one ObjectSignature to the current control list.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectSignature
idCannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty
x, yValues ignored
dataSignature object or control (not SigCtlXHTML if ObjectHash used)
optionsKey object for signature integrity (optional)
Return Value
None

addObject (ObjectInput)

Provides an input mechanism for PIN code entry.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectInput
idCannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty
x, yValues ignored
dataInputObj for pin pad input
optionsNot used; should be omitted
Return Value
None

addObject (ObjectInputEcho)

Specifies location and character to use for ObjectInput 'echo'.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectInputEcho
idCannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty
x, yIgnored
dataCharacter used for each button press
optionsEither, a combination of values from the InputEchoOptions enum or an ObjectOptions object (optional).
Return Value
None

addObject (ObjectHash)

Supplies a Hash object to be bound to the captured signature. Only one ObjectHash per control list. Cannot be used with SigCtlXHTML.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectHash
idCannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or an empty string
x, yValues ignored
dataHash object representing data to be bound to a captured signature
optionsNot used; should be omitted
Return Value
None

addObject (ObjectImage)

Displays an image on the pad. Can be clickable to generate pen events.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectImage
idSame reserved IDs as AddObject(ObjectButton)
x, yTop left position; Value can either be absolute position in pixels, or one of the strings:
X: "left", "right", "centre"
Y: "top", "middle", "bottom"
dataImage to display. Can be:
  • Filename: Name, including path, of image file
  • URL: URL of an image file. A string value is assumed to be a URL if it contains "://", otherwise it is to be a filename
  • Picture: OLE picture object (IPicture or IPictDisp interface)
  • Image data: Binary image data as an array of bytes
optionsNot used; should be omitted
Return Value
None

addObject (ObjectDisplayAtShutdown)

Causes current controls to remain on pad display after disconnection.

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectDisplayAtShutdown
idCannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty
x, yValues ignored
dataNot used; should be omitted
optionsNot used; should be omitted
Return Value
None

addObject (ObjectInking)

Provides a mechanism for capturing pad 'ink' as an image

public native void addObject(int type, String id, Object x, Object y, Object data, Object options)
Parameters
typeObjectInking
idCannot be any of the values reserved for text or button objects:
who, why, Ok, Clear, Cancel; can be null or an empty string
x, yValues ignored
dataNot used, should be omitted
optionsNot used, should be omitted
Return Value
None

addPrimitive

Adds a graphics primitive item to the internal list.

public native void addPrimitive(int type, Object x1, Object y1, Object x2, Object y2, Object primdata, Object options)
Parameters
typePrimitiveType enum value
x1, y1If Type is PrimitiveLine, start position of line; otherwise position of top-left corner. Value can be absolute pixels or:
X1: "left", "right", "centre"
Y1: "top", "middle", "bottom"
x2, y2If Type is PrimitiveLine, end position of line; otherwise position of bottom-right corner. Value can be absolute pixels or:
X2: "left", "right", "centre"
Y2: "top", "middle", "bottom"
or a string in the format "+V" or " V" (where V is an integer) for a value relative to X1 or Y1.
primdataLine width in pixels (Optional, default 1)
optionsCombination of PrimitiveOptions values (Optional, default PrimitiveLineSolid + PrimitiveOutline)
Return Value
None

getObjectState

Returns state information of a given object or an empty Variant if it doesn't exist.

public native Object getObjectState(String id)
Parameters
idIdentifier of object
Return Value
  • ObjectCheckbox: 1 = Checked; 0 = Unchecked
  • ObjectInput: number of characters in input buffer
  • Other object types: Integer, value undefined
  • Unknown Id: Empty object

setFont

Sets the current font for new wizard objects.

public native void setFont(Font font)
Parameters
fontFont selection
Return Value
None

setEventHandler

Sets the function to be called to handle tablet control events.

public void setEventHandler(WizCtlEvents handler)
Parameters
handlerWizCtlEvents event handler
Return Value
None

display

Clears current display contents, turns on backlight (if not already on), updates display with all buffered objects and primitives and enables event handling.

public native void display()
Parameters
None
Return Value
None

fireClick

Simulates 'click' on an object (button, checkbox, image, etc).

public native void fireClick(String id)
Parameters
idId of pad control to simulate click
Return Value
None

processEvents

Waits for pad input, delivered through onPadEvent().

NB

This has no equivalent (nor is needed) in the Microsoft COM interface. Once display() has been called, call this method to wait for input from the pad, which is delivered through implementing onPadEvent(). This call does not return until onPadEvent() returns false, the thread is interrupted or endProcessEvents() is called.

public native void processEvents() throws InterruptedException
Parameters
None
Return Value
None

endProcessEvents

Terminates processEvents().

NB

This has no equivalent (nor is needed) in the Microsoft COM interface. Call this method to signal the processEvents method to terminate and return.

public native void endProcessEvents()
Parameters
None
Return Value
None

close

"Closes" the object, releasing the underlying COM object (and thus freeing resources).

While the COM object is also released by finalize() during garbage collection, experience has shown that creating numerous WizCtl objects, for example as part of a frequently repeated process, can lead to problems if close() calls are not used.

public native void close()
Parameters
None
Return Value
None

Properties

PropertyTypeDescription
inkingPadboolean (read-only)True if the pad has a supported LCD display
enableWizardDisplayboolean (read/write)Enables/disables wizard controls
padWidthint (read-only)Width of pad display in pixels
padHeightint (read-only)Height of pad display in pixels
zoomfloat (read/write)Scaling of pad; 100 = 100%
licenceString (read/write)Contains a licence string