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.Runnablethe abstract base class for all sign tasks
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classAbstractSignTask.SignatureInterruptExceptionThe Class SignatureInterruptException.
-
Field Summary
Fields Modifier and Type Field Description protected booleanacceptSignatureprotected booleancancelSigningThe cancel signing.protected SoDeviceConfigurationconfigurationThe device configuration.protected SignatureContextcontextThe context.protected SignatureListenerlistenerThe listener.protected java.io.FileloadDocTempFileThe load doc temp file.protected static java.util.logging.LoggerlogThe log.protected booleanrepeatSigningThe repeat signing.protected SignersignerThe signer *.protected booleansignInDocModeprotected booleansigningButtonsVisibleprotected SignatureResult.StatestateThe state.protected booleanstopSigningThe 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 voidactivateEmulationMode()activates emulation mode.voidcleanup()Cleanup.voidcloseDoc()Close doc.protected java.awt.image.BufferedImagecreateAlpha(java.awt.image.BufferedImage src, int setAlpha)Creates the alpha.MetaInfoFieldgetMeta(java.lang.String type)Gets the meta.java.awt.image.BufferedImagegetSignatureBitmap()Gets the signature bitmap.java.awt.image.BufferedImagegetSignImage()Gets the sign image.SignatureResult.StategetState()Gets the state.booleanisSignInDocMode()booleanisSigningFinished()Checks if signing is finished.booleanisSigningStarted()voidloadDoc(java.io.InputStream inputStream)Load doc.voidresetSigningFinished()abstract voidrun()Run.protected voidsetButtonsDuringSignatureVisible(boolean visible)voidsetConfiguration(SoDeviceConfiguration configuration)Sets the configuration.voidsetContext(SignatureContext context)Sets the context.voidsetDocViewSignatureImage()Sets the signature image.voidsetListener(SignatureListener listener)Sets the listener.voidsetMetaInfoFields(MetaInfoField[] metaInfoFields)Sets the meta info fields.voidsetPreliminaryDocHash(byte[] hash)voidsetSignatureCallbacks(SoDeviceConfiguration configuration)Sets the signature callbacks.voidsetSignatureRectangle(int x1, int y1, int x2, int y2, int color)Sets the signature rectangle.booleansetSignDocMode()Sets the sign doc mode.voidsetSigner(Signer signer)Sets the signer.intsetSignImage(java.awt.image.BufferedImage signImage, boolean delta)Sets the sign image.voidsetSignInDocMode(boolean signInDocMode)java.io.InputStreamsignDoc(SignatureContext context, java.awt.image.BufferedImage image, boolean certificateSignature)Sign doc.voidstartCapture()Start capture.voidstopCapture()Stop capture.voidstopSigning()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 OpenSignatureExceptionLoad 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 OpenSignatureExceptionSets 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 OpenSignatureExceptionStart 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:
runin 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 OpenSignatureExceptionGets 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()
-
-