Class AbstractSignTask
- java.lang.Object
-
- com.stepover.opensignatureapi.signer.task.AbstractSignTask
-
- All Implemented Interfaces:
java.lang.Runnable
- Direct Known Subclasses:
SoDefaultSignTask
,SoHeadlessSignTask
public abstract class AbstractSignTask extends java.lang.Object implements java.lang.Runnable
the abstract base class for all sign tasks
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
AbstractSignTask.SignatureInterruptException
The Class SignatureInterruptException.
-
Field Summary
Fields Modifier and Type Field Description protected boolean
acceptSignature
protected boolean
cancelSigning
The cancel signing.protected SoDeviceConfiguration
configuration
The device configuration.protected SignatureContext
context
The context.protected SignatureListener
listener
The listener.protected java.io.File
loadDocTempFile
The load doc temp file.protected static java.util.logging.Logger
log
The log.protected boolean
repeatSigning
The repeat signing.protected Signer
signer
The signer *.protected boolean
signInDocMode
protected boolean
signingButtonsVisible
protected SignatureResult.State
state
The state.protected boolean
stopSigning
The is signing.
-
Constructor Summary
Constructors Constructor Description AbstractSignTask()
Instantiates a new abstract sign task.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
activateEmulationMode()
activates emulation mode.void
cleanup()
Cleanup.void
closeDoc()
Close doc.protected java.awt.image.BufferedImage
createAlpha(java.awt.image.BufferedImage src, int setAlpha)
Creates the alpha.MetaInfoField
getMeta(java.lang.String type)
Gets the meta.java.awt.image.BufferedImage
getSignatureBitmap()
Gets the signature bitmap.java.awt.image.BufferedImage
getSignImage()
Gets the sign image.SignatureResult.State
getState()
Gets the state.boolean
isSignInDocMode()
boolean
isSigningFinished()
Checks if signing is finished.boolean
isSigningStarted()
void
loadDoc(java.io.InputStream inputStream)
Load doc.void
resetSigningFinished()
abstract void
run()
Run.protected void
setButtonsDuringSignatureVisible(boolean visible)
void
setConfiguration(SoDeviceConfiguration configuration)
Sets the configuration.void
setContext(SignatureContext context)
Sets the context.void
setDocViewSignatureImage()
Sets the signature image.void
setListener(SignatureListener listener)
Sets the listener.void
setMetaInfoFields(MetaInfoField[] metaInfoFields)
Sets the meta info fields.void
setPreliminaryDocHash(byte[] hash)
void
setSignatureCallbacks(SoDeviceConfiguration configuration)
Sets the signature callbacks.void
setSignatureRectangle(int x1, int y1, int x2, int y2, int color)
Sets the signature rectangle.boolean
setSignDocMode()
Sets the sign doc mode.void
setSigner(Signer signer)
Sets the signer.int
setSignImage(java.awt.image.BufferedImage signImage, boolean delta)
Sets the sign image.void
setSignInDocMode(boolean signInDocMode)
java.io.InputStream
signDoc(SignatureContext context, java.awt.image.BufferedImage image, boolean certificateSignature)
Sign doc.void
startCapture()
Start capture.void
stopCapture()
Stop capture.void
stopSigning()
Stop signing.
-
-
-
Field Detail
-
log
protected static final java.util.logging.Logger log
The log.
-
context
protected SignatureContext context
The context.
-
listener
protected SignatureListener listener
The listener.
-
configuration
protected SoDeviceConfiguration configuration
The device configuration.
-
signer
protected Signer signer
The signer *.
-
loadDocTempFile
protected java.io.File loadDocTempFile
The load doc temp file.
-
stopSigning
protected volatile boolean stopSigning
The is signing.
-
cancelSigning
protected volatile boolean cancelSigning
The cancel signing.
-
repeatSigning
protected volatile boolean repeatSigning
The repeat signing.
-
acceptSignature
protected volatile boolean acceptSignature
-
state
protected SignatureResult.State state
The state.
-
signInDocMode
protected boolean signInDocMode
-
signingButtonsVisible
protected boolean signingButtonsVisible
-
-
Method Detail
-
getMeta
public MetaInfoField getMeta(java.lang.String type)
Gets the meta.- Parameters:
type
- the type- Returns:
- the meta
-
loadDoc
public void loadDoc(java.io.InputStream inputStream) throws OpenSignatureException
Load doc.- Parameters:
inputStream
- the input stream- Throws:
OpenSignatureException
- the open signature exception
-
signDoc
public java.io.InputStream signDoc(SignatureContext context, java.awt.image.BufferedImage image, boolean certificateSignature) throws OpenSignatureException
Sign doc.- Parameters:
context
- the contextimage
- the imagecertificateSignature
- the certificate signature- Returns:
- the image input stream
- Throws:
OpenSignatureException
- the open signature exception
-
setDocViewSignatureImage
public void setDocViewSignatureImage() throws OpenSignatureException
Sets the signature image.- Throws:
OpenSignatureException
- the open signature exception
-
setConfiguration
public void setConfiguration(SoDeviceConfiguration configuration)
Sets the configuration.- Parameters:
configuration
- the new configuration
-
setContext
public void setContext(SignatureContext context)
Sets the context.- Parameters:
context
- the new context
-
setListener
public void setListener(SignatureListener listener)
Sets the listener.- Parameters:
listener
- the new listener
-
setSigner
public void setSigner(Signer signer)
Sets the signer.- Parameters:
signer
- the new signer
-
setMetaInfoFields
public void setMetaInfoFields(MetaInfoField[] metaInfoFields)
Sets the meta info fields.- Parameters:
metaInfoFields
- the new meta info fields
-
startCapture
public void startCapture() throws OpenSignatureException
Start capture.- Throws:
OpenSignatureException
- the open signature exception
-
stopCapture
public void stopCapture()
Stop capture.
-
activateEmulationMode
public void activateEmulationMode()
activates emulation mode.
-
closeDoc
public void closeDoc()
Close doc.
-
cleanup
public void cleanup()
Cleanup.
-
setSignDocMode
public boolean setSignDocMode()
Sets the sign doc mode.
-
createAlpha
protected java.awt.image.BufferedImage createAlpha(java.awt.image.BufferedImage src, int setAlpha)
Creates the alpha.- Parameters:
src
- the srcsetAlpha
- the set alpha- Returns:
- the buffered image
-
isSigningFinished
public boolean isSigningFinished()
Checks if signing is finished.- Returns:
- true, if signing is finished
-
resetSigningFinished
public void resetSigningFinished()
-
getSignatureBitmap
public java.awt.image.BufferedImage getSignatureBitmap()
Gets the signature bitmap.- Returns:
- the signature bitmap
-
stopSigning
public void stopSigning()
Stop signing.
-
run
public abstract void run()
Run.- Specified by:
run
in interfacejava.lang.Runnable
-
getState
public SignatureResult.State getState()
Gets the state.- Returns:
- the state
-
setSignImage
public int setSignImage(java.awt.image.BufferedImage signImage, boolean delta)
Sets the sign image.- Parameters:
signImage
- the sign imagedelta
- the delta
-
getSignImage
public java.awt.image.BufferedImage getSignImage() throws OpenSignatureException
Gets the sign image.- Returns:
- the sign image
- Throws:
OpenSignatureException
- the open signature exception
-
setSignatureRectangle
public void setSignatureRectangle(int x1, int y1, int x2, int y2, int color)
Sets the signature rectangle.- Parameters:
x1
- the x1y1
- the y1x2
- the x2y2
- the y2color
- the color
-
setSignatureCallbacks
public void setSignatureCallbacks(SoDeviceConfiguration configuration)
Sets the signature callbacks.- Parameters:
configuration
- the new signature callbacks
-
setPreliminaryDocHash
public void setPreliminaryDocHash(byte[] hash)
-
setButtonsDuringSignatureVisible
protected void setButtonsDuringSignatureVisible(boolean visible)
-
isSignInDocMode
public boolean isSignInDocMode()
-
setSignInDocMode
public void setSignInDocMode(boolean signInDocMode)
-
isSigningStarted
public boolean isSigningStarted()
-
-