- 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.TextSelectionViewHandler
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,MouseWheelListener,EventListener,MouseInputListener,ToolHandler
public class TextSelectionViewHandler extends TextSelection implements ToolHandler, MouseWheelListener
TextSelectionViewHandler propagates text selection events into the views child page components. This handle is required for multi-page text selection. On mouse click all text selection states are removed.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisDraggingprotected booleanisSelectingprotected static Loggerloggerprotected JComponentparentComponent-
Fields inherited from class org.icepdf.ri.common.tools.TextSelection
bottomMargin, bottomMarginExclusion, enableMarginExclusion, enableMarginExclusionBorder, lastMouseLocation, lastMousePressedLocation, 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 TextSelectionViewHandler(DocumentViewController documentViewController, JComponent parentComponent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected JPopupMenubuildEditTextContextMenu(PageViewComponentImpl pageComponent, Point coords)protected JPopupMenubuildSelectedTextContextMenu(PageViewComponentImpl pageComponent)voidinstallTool()Callback code that allows post construct task to take place when the tool is selected via theAbstractDocumentView.setToolMode(int)call.voidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)voidmouseWheelMoved(MouseWheelEvent e)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
-
-
-
-
Field Detail
-
logger
protected static final Logger logger
-
parentComponent
protected final JComponent parentComponent
-
isDragging
protected boolean isDragging
-
isSelecting
protected boolean isSelecting
-
-
Constructor Detail
-
TextSelectionViewHandler
public TextSelectionViewHandler(DocumentViewController documentViewController, JComponent parentComponent)
-
-
Method Detail
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressedin interfaceMouseListener
-
buildSelectedTextContextMenu
protected JPopupMenu buildSelectedTextContextMenu(PageViewComponentImpl pageComponent)
-
buildEditTextContextMenu
protected JPopupMenu buildEditTextContextMenu(PageViewComponentImpl pageComponent, Point coords)
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseWheelMoved
public void mouseWheelMoved(MouseWheelEvent e)
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
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
-
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExitedin interfaceMouseListener
-
-