public final class EasyScript
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LIBRARY_BUILD_DATE
This contains the date on which the library was built (YYYY-MM-DD HH:MM:SS).
|
static java.lang.String |
LIBRARY_VERSION
This contains the current version of the library.
|
| Constructor and Description |
|---|
EasyScript()
Constructor, creates a new instance of this type.
|
EasyScript(SignatureProtocol signatureProtocol,
CardSwipeProtocol cardProtocol)
Constructor, creates a new instance of this type.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(EasyScriptEventListener cr)
Adds a listener interested in EasyScript events to the list of listeners
to notify.
|
CardSwipeProtocol |
getCardProtocol()
Gets the current card protocol.
|
SignatureProtocol |
getSignatureProtocol()
Gets the current signature protocol.
|
void |
parse(char chr)
This method allows you to stream in a set of characters and the library
will attempt to decode signatures and card swipes as the characters are
passed in.
|
void |
parse(java.awt.event.KeyEvent evt)
This method attempts to parse a stream of keyboard events coming into a
JFrame and turning them into characters which then get passed to parse(char c).
|
CardSwipe |
parseCardSwipe(java.lang.String swipe)
This method attempts to parse a magnetic card swipe from a ScripTouch
device with a magnetic strip reader.
|
Signature |
parseSignature(java.lang.String sig)
This method takes an EasyScript string and attempts to parse it into
a signature object.
|
void |
removeListener(EasyScriptEventListener cr)
Removes a listener interested in EasyScript events from the list of listeners
to notify.
|
java.awt.image.BufferedImage |
renderSignature(Signature s,
java.awt.Color foreColor,
java.awt.Color backColor,
int lineThickness,
float scale)
This method will take a signature and will attempt to render it onto a
buffered image object.
|
public static final java.lang.String LIBRARY_VERSION
public static final java.lang.String LIBRARY_BUILD_DATE
public EasyScript()
public EasyScript(SignatureProtocol signatureProtocol, CardSwipeProtocol cardProtocol)
signatureProtocol - Protocol for the device you're trying to decode signatures for.cardProtocol - Protocol for the device you're trying to decode card swipes for.public java.awt.image.BufferedImage renderSignature(Signature s, java.awt.Color foreColor, java.awt.Color backColor, int lineThickness, float scale)
s - Signature to renderforeColor - Foreground color (signature color) to use.backColor - Background color, null for transparent.lineThickness - The thickness of each stroke in pixels (not scaled).scale - How much to scale the resulting image.public CardSwipe parseCardSwipe(java.lang.String swipe) throws CardSwipeInvalidException
swipe - ScripTouch magnetic strip data.CardSwipeInvalidException - Thrown in the event the card couldn't be properly parsed.public Signature parseSignature(java.lang.String sig) throws SignatureInvalidException
sig - Signature string to parse.SignatureInvalidException - Thrown in the event there is something wrong with the string.public void parse(char chr)
throws SignatureInvalidException
chr - Next character in the stream to parse.SignatureInvalidException - Thrown in the event an unexpected condition occurs while parsing the stream.public void parse(java.awt.event.KeyEvent evt)
throws SignatureInvalidException
evt - Keyboard event to evaluate.SignatureInvalidException - Thrown in the event of an unexpected condition.public SignatureProtocol getSignatureProtocol()
public CardSwipeProtocol getCardProtocol()
public void addListener(EasyScriptEventListener cr)
cr - The listener to add to the list.public void removeListener(EasyScriptEventListener cr)
cr - The listener to remove from the list.