org.icepdf.ri.common.tools
Class SelectionBoxHandler
java.lang.Object
org.icepdf.ri.common.tools.CommonToolHandler
org.icepdf.ri.common.tools.SelectionBoxHandler
- Direct Known Subclasses:
- FreeTextAnnotationHandler, LineAnnotationHandler, LinkAnnotationHandler, SquareAnnotationHandler, TextSelection, ZoomInPageHandler, ZoomInViewHandler
public abstract class SelectionBoxHandler
- extends CommonToolHandler
Handles the drawing of a selection box commonly used for selection
type tools.
- Since:
- 4.0
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dash1
protected static float[] dash1
stroke
protected static java.awt.BasicStroke stroke
currentRect
protected java.awt.Rectangle currentRect
rectToDraw
protected java.awt.Rectangle rectToDraw
previousRectDrawn
protected java.awt.Rectangle previousRectDrawn
selectionBoxColour
protected static java.awt.Color selectionBoxColour
SelectionBoxHandler
protected SelectionBoxHandler(DocumentViewController documentViewController,
AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
setSelectionRectangle
public abstract void setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
paintSelectionBox
public static void paintSelectionBox(java.awt.Graphics g,
java.awt.Rectangle rectToDraw)
resetRectangle
public void resetRectangle(int x,
int y)
getCurrentRect
public java.awt.Rectangle getCurrentRect()
setCurrentRect
public void setCurrentRect(java.awt.Rectangle currentRect)
getRectToDraw
public java.awt.Rectangle getRectToDraw()
setRectToDraw
public void setRectToDraw(java.awt.Rectangle rectToDraw)
clearRectangle
public void clearRectangle(java.awt.Component component)
updateSelectionSize
public void updateSelectionSize(int x,
int y,
java.awt.Component component)
- Update the size of the selection rectangle.
- Parameters:
x - x-coordinate of the selection size update.y - y-coordinate of the selection size update.
setSelectionSize
public void setSelectionSize(java.awt.Rectangle rect,
java.awt.Component component)
updateDrawableRect
public void updateDrawableRect(int compWidth,
int compHeight)
- Update the drawable rectangle so that it does not extend bast the edge
of the page.
- Parameters:
compWidth - width of component being selectedcompHeight - height of component being selected.
isOverPageComponent
protected PageViewComponentImpl isOverPageComponent(java.awt.Container container,
java.awt.event.MouseEvent e)
- Utility method for determining if the mouse event occurred over a
page in the page view.
- Parameters:
e - mouse event in this coordinates space
- Returns:
- component that mouse event is over or null if not over a page.