- java.lang.Object
-
- org.icepdf.ri.common.tools.CommonToolHandler
-
- org.icepdf.ri.common.tools.SelectionBoxHandler
-
- org.icepdf.ri.common.tools.TextSelection
-
- org.icepdf.ri.common.tools.EditTextHandler
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener,MouseInputListener,ToolHandler
public class EditTextHandler extends TextSelection implements ToolHandler
EditTextHandler is a tool handler that allows the user to edit text. Text selection can be specified by either work or line. The text is selected and a dialog is shown to allow the user to edit the text. The edited text is then used to update the content stream of the page.Editing success depends on how the text was encoded in the PDF. If the text has been encoded using a sub font that does not contain the glyphs for the text, then the text will be editable but may not be displayed correctly. In such a case the dialog will show warning message that the text may not be displayed correctly.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEditTextHandler.TextEditDialogTextEditDialog is a simple dialog that allows the user to edit text that was selected by teh edit text tool.
-
Field Summary
-
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 EditTextHandler(SwingController controller, AbstractPageViewComponent pageViewComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voideditLine(Point selectionPoint)voideditWord(Point selectionPoint)voidinstallTool()Callback code that allows post construct task to take place when the tool is selected via theAbstractDocumentView.setToolMode(int)call.voidmouseClicked(MouseEvent mouseEvent)voidmouseDragged(MouseEvent mouseEvent)voidmouseEntered(MouseEvent mouseEvent)voidmouseExited(MouseEvent mouseEvent)voidmouseMoved(MouseEvent mouseEvent)voidmousePressed(MouseEvent mouseEvent)voidmouseReleased(MouseEvent mouseEvent)voidpaintTool(Graphics g)Paints the tools pre-annotation creation state.voiduninstallTool()Callback code that allows pre destroy task to take place when the tool is unselected via theAbstractDocumentView.setToolMode(int)call.-
Methods inherited from class org.icepdf.ri.common.tools.TextSelection
calculateTextSelectionExclusion, checkAndApplyPreferences, clearSelection, clearSelectionState, convertTextShapesToBounds, convertToPageSpace, lineSelectHandler, multiLineSelectHandler, paintSelectedText, paintTextBounds, selection, selectionEnd, selectionStart, selectionTextSelectIcon, setBottomMargin, setSelectionRectangle, setTopMargin, wordLineSelection, wordSelectHandler
-
Methods inherited from class org.icepdf.ri.common.tools.SelectionBoxHandler
clearRectangle, getCurrentRect, getRectToDraw, isOverPageComponent, paintRectangle, 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
-
EditTextHandler
public EditTextHandler(SwingController controller, AbstractPageViewComponent pageViewComponent)
-
-
Method Detail
-
editWord
public void editWord(Point selectionPoint)
-
editLine
public void editLine(Point selectionPoint)
-
paintTool
public void paintTool(Graphics g)
Description copied from interface:ToolHandlerPaints the tools pre-annotation creation state.- Specified by:
paintToolin interfaceToolHandler- Parameters:
g- graphics context
-
installTool
public void installTool()
Description copied from interface:ToolHandlerCallback code that allows post construct task to take place when the tool is selected via theAbstractDocumentView.setToolMode(int)call.- Specified by:
installToolin interfaceToolHandler
-
uninstallTool
public void uninstallTool()
Description copied from interface:ToolHandlerCallback code that allows pre destroy task to take place when the tool is unselected via theAbstractDocumentView.setToolMode(int)call.- Specified by:
uninstallToolin interfaceToolHandler
-
mouseClicked
public void mouseClicked(MouseEvent mouseEvent)
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
public void mousePressed(MouseEvent mouseEvent)
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
public void mouseReleased(MouseEvent mouseEvent)
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
public void mouseEntered(MouseEvent mouseEvent)
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent mouseEvent)
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseDragged
public void mouseDragged(MouseEvent mouseEvent)
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
public void mouseMoved(MouseEvent mouseEvent)
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
-