public class TextSelectionPageHandler extends SelectionBoxHandler implements ToolHandler
| Modifier and Type | Field and Description |
|---|---|
static java.awt.Color |
highlightColor |
protected static java.util.logging.Logger |
logger |
int |
selectedCount |
static float |
selectionAlpha
Transparency value used to simulate text highlighting.
|
static java.awt.Color |
selectionColor |
currentRect, dash1, previousRectDrawn, rectToDraw, selectionBoxColour, strokedocumentViewController, documentViewModel, pageViewComponent| Constructor and Description |
|---|
TextSelectionPageHandler(DocumentViewController documentViewController,
AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
New Text selection handler.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
static void |
paintSelectedText(java.awt.Graphics g,
AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
Utility for painting the highlight and selected
|
void |
paintTool(java.awt.Graphics g)
Paints the tools pre-annotation creation state.
|
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. |
clearRectangle, getCurrentRect, getRectToDraw, isOverPageComponent, paintSelectionBox, resetRectangle, setCurrentRect, setRectToDraw, setSelectionSize, updateDrawableRect, updateSelectionSizeconvertToPageSpace, getPageTransformprotected static final java.util.logging.Logger logger
public static final float selectionAlpha
public static java.awt.Color selectionColor
public int selectedCount
public static java.awt.Color highlightColor
public TextSelectionPageHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent, DocumentViewModel documentViewModel)
pageViewComponent - page component that this handler is bound to.documentViewModel - view model.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 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.MouseMotionListenerpublic void setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
setSelectionRectangle in class SelectionBoxHandlerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic static void paintSelectedText(java.awt.Graphics g,
AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
g - graphics to paint to.public 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)
ToolHandlerpaintTool in interface ToolHandlerg - graphics context