|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.views.common.SelectionBoxHandler
org.icepdf.core.views.common.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 | |
|---|---|
static java.awt.Color |
highlightColor
|
static float |
selectionAlpha
Tranparencey value used to simulate text highlighting. |
static java.awt.Color |
selectionColor
|
| Fields inherited from class org.icepdf.core.views.common.SelectionBoxHandler |
|---|
currentRect, dash1, previousRectDrawn, rectToDraw, selectionBoxColour, stroke |
| Constructor Summary | |
|---|---|
TextSelectionPageHandler(AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
New Text selection handler. |
|
| Method Summary | |
|---|---|
void |
clearSelection()
|
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 |
paintSelectedText(java.awt.Graphics g)
Utility for painting the highlight and selected |
void |
setDocumentViewController(DocumentViewController documentViewController)
Document view controller callback setup. |
void |
setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
|
| Methods inherited from class org.icepdf.core.views.common.SelectionBoxHandler |
|---|
clearRectangle, getCurrentRect, getRectToDraw, paintSelectionBox, resetRectangle, setCurrentRect, setRectToDraw, setSelectionSize, updateDrawableRect, updateSelectionSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final float selectionAlpha
public static java.awt.Color selectionColor
public static java.awt.Color highlightColor
| Constructor Detail |
|---|
public TextSelectionPageHandler(AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
pageViewComponent - page component that this handler is bound to.documentViewModel - view model.| Method Detail |
|---|
public void setDocumentViewController(DocumentViewController documentViewController)
documentViewController - document controller callback.public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void clearSelection()
public 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 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.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.MouseMotionListener
public void setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void paintSelectedText(java.awt.Graphics g)
g - graphics to paint to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||