-
- All Implemented Interfaces:
ActionListener,KeyListener,MouseListener,MouseMotionListener,EventListener,MouseInputListener,ToolHandler
public class RedactionAnnotationHandler extends HighLightAnnotationHandler
RedactionAnnotationHandler tool extends HighlightSelectionPageHandler which takes care visually selected text as the mouse is dragged across text on the current page as well as double and triple word selection. The tool also allows the selection of image content for redactoin
Redaction annotation type only marks section of the PDF document for redaction. For content to be removed the document must be exported using the DocumentBuilder WriteMode.FULL_UPDATE mode. During the export all content is removed from the PDF.- Since:
- 7.2.0
-
-
Field Summary
-
Fields inherited from class org.icepdf.ri.common.tools.HighLightAnnotationHandler
annotation, enableHighlightContents, markupSubType
-
Fields inherited from class org.icepdf.ri.common.tools.TextSelectionPageHandler
isClearSelection, isMouseDrag
-
Fields inherited from class org.icepdf.ri.common.tools.TextSelection
bottomMargin, bottomMarginExclusion, enableMarginExclusion, enableMarginExclusionBorder, lastMouseLocation, lastMousePressedLocation, logger, pageLock, selectedCount, topMargin, topMarginExclusion
-
Fields inherited from class org.icepdf.ri.common.tools.SelectionBoxHandler
currentRect, dash1, previousRectDrawn, rectToDraw, selectionBoxColour, stroke
-
Fields inherited from class org.icepdf.ri.common.tools.CommonToolHandler
documentViewController, pageViewComponent, preferences
-
-
Constructor Summary
Constructors Constructor Description RedactionAnnotationHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateMarkupAnnotationFromSelectionBox()protected voidcreateMarkupAnnotationFromTextSelection(MouseEvent e)voidcreateRedactionAnnotation(ArrayList<Shape> redactionBounds)voidmouseDragged(MouseEvent e)Invoked when a mouse button is pressed on a component and then dragged.voidmouseMoved(MouseEvent e)Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.voidmousePressed(MouseEvent e)Invoked when a mouse button has been pressed on a component.voidmouseReleased(MouseEvent e)Invoked when a mouse button has been released on a component.protected voidpaintRectangle(Graphics2D gg, Rectangle rectToDraw)voidpaintTool(Graphics g)Paints the tools pre-annotation creation state.voidselectionImageSelectIcon(Point mouseLocation, AbstractPageViewComponent pageViewComponent)-
Methods inherited from class org.icepdf.ri.common.tools.HighLightAnnotationHandler
actionPerformed, checkAndApplyPreferences, createMarkupAnnotation, getSelectedText, getSelectedTextBounds, installTool, keyPressed, keyReleased, keyTyped, mouseClicked, uninstallTool
-
Methods inherited from class org.icepdf.ri.common.tools.TextSelectionPageHandler
cancelSelection, mouseEntered, mouseExited, setDocumentViewController, setSelectionRectangle
-
Methods inherited from class org.icepdf.ri.common.tools.TextSelection
calculateTextSelectionExclusion, clearSelection, clearSelectionState, convertTextShapesToBounds, convertToPageSpace, lineSelectHandler, multiLineSelectHandler, paintSelectedText, paintTextBounds, selection, selectionEnd, selectionStart, selectionTextSelectIcon, setBottomMargin, setTopMargin, wordLineSelection, wordSelectHandler
-
Methods inherited from class org.icepdf.ri.common.tools.SelectionBoxHandler
clearRectangle, getCurrentRect, getRectToDraw, isOverPageComponent, paintSelectionBox, resetRectangle, setCurrentRect, setRectToDraw, setSelectionSize, updateDrawableRect, updateSelectionSize
-
Methods inherited from class org.icepdf.ri.common.tools.CommonToolHandler
convertToPageSpace, convertToPageSpace, convertToPageSpace, convertToPageSpace, getPageTransform, getPageTransform, getToPageSpaceTransform, getToPageSpaceTransform
-
-
-
-
Constructor Detail
-
RedactionAnnotationHandler
public RedactionAnnotationHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)
-
-
Method Detail
-
createMarkupAnnotationFromTextSelection
protected void createMarkupAnnotationFromTextSelection(MouseEvent e)
- Overrides:
createMarkupAnnotationFromTextSelectionin classHighLightAnnotationHandler
-
mouseMoved
public void mouseMoved(MouseEvent e)
Description copied from class:TextSelectionPageHandlerInvoked when the mouse cursor has been moved onto a component but no buttons have been pushed.- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classTextSelectionPageHandler
-
mousePressed
public void mousePressed(MouseEvent e)
Description copied from class:TextSelectionPageHandlerInvoked when a mouse button has been pressed on a component.- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classTextSelectionPageHandler
-
mouseReleased
public void mouseReleased(MouseEvent e)
Description copied from class:HighLightAnnotationHandlerInvoked when a mouse button has been released on a component.- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classHighLightAnnotationHandler
-
mouseDragged
public void mouseDragged(MouseEvent e)
Description copied from class:TextSelectionPageHandlerInvoked when a mouse button is pressed on a component and then dragged.MOUSE_DRAGGEDevents will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).
Due to platform-dependent Drag&Drop implementations,MOUSE_DRAGGEDevents may not be delivered during a native Drag&Drop operation.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classTextSelectionPageHandler
-
paintTool
public void paintTool(Graphics g)
Description copied from interface:ToolHandlerPaints the tools pre-annotation creation state.- Specified by:
paintToolin interfaceToolHandler- Overrides:
paintToolin classTextSelectionPageHandler- Parameters:
g- graphics context
-
paintRectangle
protected void paintRectangle(Graphics2D gg, Rectangle rectToDraw)
- Overrides:
paintRectanglein classSelectionBoxHandler
-
selectionImageSelectIcon
public void selectionImageSelectIcon(Point mouseLocation, AbstractPageViewComponent pageViewComponent)
-
createMarkupAnnotationFromSelectionBox
public void createMarkupAnnotationFromSelectionBox()
-
-