- java.lang.Object
-
- org.icepdf.ri.common.tools.CommonToolHandler
-
- org.icepdf.ri.common.tools.SelectionBoxHandler
-
- Direct Known Subclasses:
FreeTextAnnotationHandler,LineAnnotationHandler,LinkAnnotationHandler,SignatureAnnotationHandler,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
-
-
Field Summary
Fields Modifier and Type Field Description protected RectanglecurrentRectprotected static float[]dash1protected RectanglepreviousRectDrawnprotected RectanglerectToDrawprotected static ColorselectionBoxColourprotected static BasicStrokestroke-
Fields inherited from class org.icepdf.ri.common.tools.CommonToolHandler
documentViewController, pageViewComponent, preferences
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSelectionBoxHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclearRectangle(Component component)RectanglegetCurrentRect()RectanglegetRectToDraw()protected PageViewComponentImplisOverPageComponent(Container container, MouseEvent e)Utility method for determining if the mouse event occurred over a page in the page view.protected voidpaintRectangle(Graphics2D gg, Rectangle rectToDraw)voidpaintSelectionBox(Graphics g, Rectangle rectToDraw)voidresetRectangle(int x, int y)voidsetCurrentRect(Rectangle currentRect)voidsetRectToDraw(Rectangle rectToDraw)abstract voidsetSelectionRectangle(Point cursorLocation, Rectangle selection)voidsetSelectionSize(Rectangle rect, Component component)voidupdateDrawableRect(int compWidth, int compHeight)Update the drawable rectangle so that it does not extend bast the edge of the page.voidupdateSelectionSize(int x, int y, Component component)Update the size of the selection rectangle.-
Methods inherited from class org.icepdf.ri.common.tools.CommonToolHandler
checkAndApplyPreferences, convertToPageSpace, convertToPageSpace, convertToPageSpace, convertToPageSpace, getPageTransform, getPageTransform, getToPageSpaceTransform, getToPageSpaceTransform
-
-
-
-
Field Detail
-
dash1
protected static final float[] dash1
-
stroke
protected static final BasicStroke stroke
-
currentRect
protected Rectangle currentRect
-
rectToDraw
protected Rectangle rectToDraw
-
previousRectDrawn
protected final Rectangle previousRectDrawn
-
selectionBoxColour
protected static Color selectionBoxColour
-
-
Constructor Detail
-
SelectionBoxHandler
protected SelectionBoxHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)
-
-
Method Detail
-
setSelectionRectangle
public abstract void setSelectionRectangle(Point cursorLocation, Rectangle selection)
-
paintRectangle
protected void paintRectangle(Graphics2D gg, Rectangle rectToDraw)
-
resetRectangle
public void resetRectangle(int x, int y)
-
getCurrentRect
public Rectangle getCurrentRect()
-
setCurrentRect
public void setCurrentRect(Rectangle currentRect)
-
getRectToDraw
public Rectangle getRectToDraw()
-
setRectToDraw
public void setRectToDraw(Rectangle rectToDraw)
-
clearRectangle
public void clearRectangle(Component component)
-
updateSelectionSize
public void updateSelectionSize(int x, int y, 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.component- component to repaint
-
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(Container container, 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 spacecontainer- to find component of mouse event source.- Returns:
- component that mouse event is over or null if not over a page.
-
-