|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.ri.common.tools.CommonToolHandler
org.icepdf.ri.common.tools.SelectionBoxHandler
org.icepdf.ri.common.tools.TextSelection
org.icepdf.ri.common.tools.TextSelectionPageHandler
public class TextSelectionPageHandler
Handles Paint and mouse/keyboard logic around text selection and search highlighting. there is on text handler isntance of each pageComponent used to dispaly the document.
The highlight colour by default is #FFF600 but can be set using color or hex values names using the system property "org.icepdf.core.views.page.text.highlightColor" The highlight colour by default is #FFF600 but can be set using color or hex values names using the system property "org.icepdf.core.views.page.text.selectionColor"
| 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, documentViewModel, pageViewComponent |
| Constructor Summary | |
|---|---|
TextSelectionPageHandler(DocumentViewController documentViewController,
AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
New Text selection handler. |
|
| Method Summary | |
|---|---|
protected java.awt.Rectangle |
convertToPageSpace(java.util.ArrayList<java.awt.Shape> bounds,
java.awt.geom.GeneralPath path)
Convert the shapes that make up the annotation to page space so that they will scale correctly at different zooms. |
void |
installTool()
Callback code that allows post construct task to take place when the tool is selected via the AbstractDocumentView.setToolMode(int)
call. |
void |
mouseClicked(java.awt.event.MouseEvent e)
When mouse is double clicked we select the word the mouse if over. |
void |
mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed. |
void |
mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component. |
void |
paintTool(java.awt.Graphics g)
Paints the tools pre-annotation creation state. |
void |
setDocumentViewController(DocumentViewController documentViewController)
|
void |
setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
|
void |
uninstallTool()
Callback code that allows pre destroy task to take place when the tool is unselected via the AbstractDocumentView.setToolMode(int)
call. |
| Methods inherited from class org.icepdf.ri.common.tools.TextSelection |
|---|
calculateTextSelectionExclusion, clearSelection, clearSelectionState, lineSelectHandler, multiLineSelectHandler, paintSelectedText, paintTextBounds, selection, selectionEnd, selectionIcon, selectionStart, 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 |
|---|
convertMouseToPageSpace, convertRectangleToPageSpace, convertToPageSpace, convertToPageSpace, getPageTransform, getPageTransform |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextSelectionPageHandler(DocumentViewController documentViewController,
AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
pageViewComponent - page component that this handler is bound to.documentViewModel - view model.| Method Detail |
|---|
public void setDocumentViewController(DocumentViewController documentViewController)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
MOUSE_DRAGGED events 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_DRAGGED events may not be delivered during a native
Drag&Drop operation.
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListener
public void setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
setSelectionRectangle in class TextSelectionpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void installTool()
ToolHandlerAbstractDocumentView.setToolMode(int)
call.
installTool in interface ToolHandlerpublic void uninstallTool()
ToolHandlerAbstractDocumentView.setToolMode(int)
call.
uninstallTool in interface ToolHandlerpublic void paintTool(java.awt.Graphics g)
ToolHandler
paintTool in interface ToolHandlerg - graphics context
protected java.awt.Rectangle convertToPageSpace(java.util.ArrayList<java.awt.Shape> bounds,
java.awt.geom.GeneralPath path)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||