Class 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
    • Field Detail

      • log

        protected static final java.util.logging.Logger log
        The log.
      • 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
      • signInDocMode

        protected boolean signInDocMode
      • signingButtonsVisible

        protected boolean signingButtonsVisible
    • Constructor Detail

      • AbstractSignTask

        public AbstractSignTask()
        Instantiates a new abstract sign task.
    • Method Detail

      • getMeta

        public MetaInfoField getMeta​(java.lang.String type)
        Gets the meta.
        Parameters:
        type - the type
        Returns:
        the meta
      • signDoc

        public java.io.InputStream signDoc​(SignatureContext context,
                                           java.awt.image.BufferedImage image,
                                           boolean certificateSignature)
                                    throws OpenSignatureException
        Sign doc.
        Parameters:
        context - the context
        image - the image
        certificateSignature - the certificate signature
        Returns:
        the image input stream
        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
      • 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 src
        setAlpha - 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 interface java.lang.Runnable
      • setSignImage

        public int setSignImage​(java.awt.image.BufferedImage signImage,
                                boolean delta)
        Sets the sign image.
        Parameters:
        signImage - the sign image
        delta - the delta
      • setSignatureRectangle

        public void setSignatureRectangle​(int x1,
                                          int y1,
                                          int x2,
                                          int y2,
                                          int color)
        Sets the signature rectangle.
        Parameters:
        x1 - the x1
        y1 - the y1
        x2 - the x2
        y2 - the y2
        color - 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()