Class FormSignedSignatureWidgetFactory
- java.lang.Object
-
- org.faceless.pdf2.viewer2.ViewerFeature
-
- org.faceless.pdf2.viewer2.AnnotationComponentFactory
-
- org.faceless.pdf2.viewer2.feature.FormSignedSignatureWidgetFactory
-
public class FormSignedSignatureWidgetFactory extends AnnotationComponentFactory
Create annotations to handleWidgetAnnotation
objects belonging to signedFormSignature
fields. When an annotation created by this field is clicked on, aSignatureProvider
wil be chosen to verify the field and that objectsshowVerifyDialog()
method called.The following initialization parameters can be specified to configure this feature, as well as those parameters specified in theThe name of this feature is FormSignedSignatureWidgetFactorySignatureProvider
API documentation.stateIcon Whether to show the icon for the current signature state. Defaults to true This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
- Since:
- 2.8, with much of the functionality moved to
SignatureProvider
in 2.11
-
-
Field Summary
-
Fields inherited from class org.faceless.pdf2.viewer2.AnnotationComponentFactory
FOCUSBORDER
-
-
Constructor Summary
Constructors Constructor Description FormSignedSignatureWidgetFactory()
Create a new FormSignedSignatureWidgetFactory that verifies against the default KeyStore.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JComponent
createComponent(PagePanel pagepanel, PDFAnnotation annot)
Return a JComponent that will visually represent the specified PDFAnnotation.boolean
matches(PDFAnnotation annot)
Return true if this AnnotationComponentFactory could create aJComponent
for the specifiedPDFAnnotation
.protected void
paintComponentAnnotations(JComponent comp, Graphics g)
Paint any visible annotations that should be drawn on top of the annotation.void
showStateIcon(boolean show)
Whether to show the icon for the current signature state on the signature itself.void
verify(FormSignature field, DocumentPanel docpanel, SignatureProvider provider)
Verify the signature field, by calling theshowVerifyDialog()
method on the specified SignatureProvider-
Methods inherited from class org.faceless.pdf2.viewer2.AnnotationComponentFactory
addStockDetailsToEditComponent, bindComponentLocation, bindComponentLocation, bindComponentLocation, bindComponentLocation, copyAnnotationState, createDeleteAction, createEditAction, createEditComponent, createFlattenAction, createNewAnnotation, createNewAnnotation, getAnnotationType, getPreferences, getViewer, initialize, isFactoryReadOnly, makeComponentInteractive, paintComponent, popupPropertyMenu, postEdit, toString
-
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown
-
-
-
-
Method Detail
-
showStateIcon
public void showStateIcon(boolean show)
Whether to show the icon for the current signature state on the signature itself. Defaults to true- Parameters:
show
- the flag- Since:
- 2.26
-
matches
public boolean matches(PDFAnnotation annot)
Description copied from class:AnnotationComponentFactory
Return true if this AnnotationComponentFactory could create aJComponent
for the specifiedPDFAnnotation
.- Specified by:
matches
in classAnnotationComponentFactory
-
paintComponentAnnotations
protected void paintComponentAnnotations(JComponent comp, Graphics g)
Description copied from class:AnnotationComponentFactory
Paint any visible annotations that should be drawn on top of the annotation. These are not to be confused withPDFAnnotation
- these annotations are simply graphical additions to the AWT component. A good example is digital signature fields, which should display a tick, cross or question-mark depending on the current verified status of the signature. The default implementation is a no-op.- Overrides:
paintComponentAnnotations
in classAnnotationComponentFactory
- See Also:
paintComponent()
,createComponent()
-
createComponent
public JComponent createComponent(PagePanel pagepanel, PDFAnnotation annot)
Description copied from class:AnnotationComponentFactory
Return a JComponent that will visually represent the specified PDFAnnotation. The default implementation returns a JPanel that will display the annotation appearance - it's usually best to call super.createComponent() then add any required listeners in the subclasses.
By default this method returns a JCompoment whose
paintComponent()
method is overridden to callpaintComponent(this, this.ui, g)
followed bypaintComponentAnnotations(this, g)
- typically, the main reason to override this method is when a different type of object is required (eg. aJTextField
)- Overrides:
createComponent
in classAnnotationComponentFactory
- Parameters:
pagepanel
- the panel the JComponent will be added toannot
- the annotation- See Also:
paintComponentAnnotations()
,paintComponent()
-
verify
public void verify(FormSignature field, DocumentPanel docpanel, SignatureProvider provider)
Verify the signature field, by calling theshowVerifyDialog()
method on the specified SignatureProvider- Parameters:
field
- the signed Signature field to verifydocpanel
- the DocumentPanelprovider
- the SignatureProvider to use to verify the signature
-
-