Class RedactSelectionAction
- java.lang.Object
-
- org.faceless.pdf2.viewer2.ViewerFeature
-
- org.faceless.pdf2.viewer2.feature.RedactSelectionAction
-
- All Implemented Interfaces:
DocumentPanelListener
,AreaSelectionAction
,TextSelectionAction
public class RedactSelectionAction extends ViewerFeature implements TextSelectionAction, AreaSelectionAction, DocumentPanelListener
ATextSelectionAction
that will redact the selected area of the PDF using theRedactor
class.The following initialization parameters can be specified to configure this feature.The name of this feature is RedactSelectionActioncolor A 32-bit color value, eg 0x80FF0000 (for translucent red) type The type of Redact - Highlight, Underline, StrikeOut or Squiggly description The description of this markup kernadjust The amount to trim the redacted area to allow for kerning - see Redactor.contractAreaAlongBaseline(float[], float)
. The default is 0.1This 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.11.8
-
-
Constructor Summary
Constructors Constructor Description RedactSelectionAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
documentUpdated(DocumentPanelEvent event)
Called when anDocumentPanelEvent
is raisedColor
getColor()
String
getDescription()
Get the name of this Action, to appear in the popup menu.void
initialize(PDFViewer viewer)
Called when the feature is first added to a viewerboolean
isEnabled()
Indicates whether this action is enabled.void
selectAction(DocumentPanel docpanel, TextSelection.RangeList list)
Run the action.void
selectArea(PagePanel pagepanel, Rectangle2D area)
Invoked when the area is selected.void
setColor(Color color)
Set the description that's returned bygetDescription()
-
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown, toString
-
-
-
-
Method Detail
-
setColor
public void setColor(Color color)
Set the description that's returned bygetDescription()
-
getColor
public Color getColor()
-
getDescription
public String getDescription()
Description copied from interface:TextSelectionAction
Get the name of this Action, to appear in the popup menu.- Specified by:
getDescription
in interfaceAreaSelectionAction
- Specified by:
getDescription
in interfaceTextSelectionAction
-
isEnabled
public boolean isEnabled()
Description copied from interface:TextSelectionAction
Indicates whether this action is enabled.- Specified by:
isEnabled
in interfaceAreaSelectionAction
- Specified by:
isEnabled
in interfaceTextSelectionAction
-
initialize
public void initialize(PDFViewer viewer)
Description copied from class:ViewerFeature
Called when the feature is first added to a viewer- Overrides:
initialize
in classViewerFeature
-
documentUpdated
public void documentUpdated(DocumentPanelEvent event)
Description copied from interface:DocumentPanelListener
Called when anDocumentPanelEvent
is raised- Specified by:
documentUpdated
in interfaceDocumentPanelListener
-
selectAction
public void selectAction(DocumentPanel docpanel, TextSelection.RangeList list)
Description copied from interface:TextSelectionAction
Run the action.- Specified by:
selectAction
in interfaceTextSelectionAction
- Parameters:
docpanel
- the DocumentPanel this action is being run on.list
- theTextSelection.RangeList
containing the list of selected text items, which may be from multiple pages
-
selectArea
public void selectArea(PagePanel pagepanel, Rectangle2D area)
Description copied from interface:AreaSelectionAction
Invoked when the area is selected.- Specified by:
selectArea
in interfaceAreaSelectionAction
- Parameters:
pagepanel
- the PagePanel the area was selected onarea
- the selected area
-
-