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 | |
| type | ObjectType enum value specifying the object type |
| id | String specifying an identifier for the object |
| x, y | Position 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" |
| data | Data dependent on the object type |
| options | Value 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 | |
| type | ObjectText |
| id | Special values when used with a signature object:
|
| x, y | Position of top left corner; absolute pixels or strings: X: "left", "right", "centre"; Y: "top", "middle", "bottom" |
| data | Text to display |
| options | Value 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 | |
| type | ObjectButton |
| id | The following values have special meanings when used with signature or input objects:
|
| x, y | Top left corner of the object; absolute pixels or strings: X: "left", "right", "centre" Y: "top", "middle", "bottom" |
| data | Text to display |
| options | Either, 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 | |
| type | ObjectCheckbox |
| id | Cannot be any reserved text or button values: who, why, OK, Clear, Cancel |
| x, y | Top 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" |
| data | Text to display |
| options | CheckboxOptions 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 | |
| type | ObjectCheckbox |
| id | Cannot be reserved button IDs: who, why, OK, Clear, Cancel |
| x, y | Top left corner; absolute pixels or: X: "left", "right", "centre" Y: "top", "middle", "bottom" |
| data | Text to display |
| options | ObjectOptions 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 | |
| type | ObjectSignature |
| id | Cannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty |
| x, y | Values ignored |
| data | Signature object or control (not SigCtlXHTML if ObjectHash used) |
| options | Key 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 | |
| type | ObjectInput |
| id | Cannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty |
| x, y | Values ignored |
| data | InputObj for pin pad input |
| options | Not 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 | |
| type | ObjectInputEcho |
| id | Cannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty |
| x, y | Ignored |
| data | Character used for each button press |
| options | Either, 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 | |
| type | ObjectHash |
| id | Cannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or an empty string |
| x, y | Values ignored |
| data | Hash object representing data to be bound to a captured signature |
| options | Not 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 | |
| type | ObjectImage |
| id | Same reserved IDs as AddObject(ObjectButton) |
| x, y | Top left position; Value can either be absolute position in pixels, or one of the strings: X: "left", "right", "centre" Y: "top", "middle", "bottom" |
| data | Image to display. Can be:
|
| options | Not 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 | |
| type | ObjectDisplayAtShutdown |
| id | Cannot be any of the values reserved for text or button objects: who, why, Ok, Clear, Cancel; can be null or empty |
| x, y | Values ignored |
| data | Not used; should be omitted |
| options | Not 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 | |
| type | ObjectInking |
| id | Cannot be any of the values reserved for text or button objects:who, why, Ok, Clear, Cancel; can be null or an empty string |
| x, y | Values ignored |
| data | Not used, should be omitted |
| options | Not 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 | |
| type | PrimitiveType enum value |
| x1, y1 | If 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, y2 | If 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. |
| primdata | Line width in pixels (Optional, default 1) |
| options | Combination 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 | |
| id | Identifier of object |
| Return Value | |
| |
setFont
Sets the current font for new wizard objects.
| public native void setFont(Font font) | |
|---|---|
| Parameters | |
| font | Font selection |
| Return Value | |
| None | |
setEventHandler
Sets the function to be called to handle tablet control events.
| public void setEventHandler(WizCtlEvents handler) | |
|---|---|
| Parameters | |
| handler | WizCtlEvents 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 | |
| id | Id of pad control to simulate click |
| Return Value | |
| None | |
processEvents
Waits for pad input, delivered through onPadEvent().
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().
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
| Property | Type | Description |
|---|---|---|
| inkingPad | boolean (read-only) | True if the pad has a supported LCD display |
| enableWizardDisplay | boolean (read/write) | Enables/disables wizard controls |
| padWidth | int (read-only) | Width of pad display in pixels |
| padHeight | int (read-only) | Height of pad display in pixels |
| zoom | float (read/write) | Scaling of pad; 100 = 100% |
| licence | String (read/write) | Contains a licence string |