public class SquareAnnotationHandler extends SelectionBoxHandler implements ToolHandler
| Modifier and Type | Field and Description |
|---|---|
protected org.icepdf.core.pobjects.annotations.BorderStyle |
borderStyle |
protected static float |
DEFAULT_STROKE_WIDTH |
protected static java.awt.Color |
internalColor |
protected static java.awt.Color |
lineColor |
protected java.awt.Rectangle |
rectangle |
protected static java.awt.BasicStroke |
stroke |
protected static float |
strokeWidth |
protected static boolean |
useInternalColor |
currentRect, dash1, previousRectDrawn, rectToDraw, selectionBoxColourdocumentViewController, documentViewModel, pageViewComponent| Constructor and Description |
|---|
SquareAnnotationHandler(DocumentViewController documentViewController,
AbstractPageViewComponent pageViewComponent,
DocumentViewModel documentViewModel)
New Text selection handler.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.awt.Rectangle |
convertToPageSpace(java.awt.Rectangle rect)
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) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
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 float DEFAULT_STROKE_WIDTH
protected static java.awt.BasicStroke stroke
protected static float strokeWidth
protected static java.awt.Color lineColor
protected static java.awt.Color internalColor
protected static boolean useInternalColor
protected java.awt.Rectangle rectangle
protected org.icepdf.core.pobjects.annotations.BorderStyle borderStyle
public SquareAnnotationHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent, DocumentViewModel documentViewModel)
pageViewComponent - page component that this handler is bound to.documentViewModel - view model.public void paintTool(java.awt.Graphics g)
ToolHandlerpaintTool in interface ToolHandlerg - graphics contextpublic 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 mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic 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 mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerprotected java.awt.Rectangle convertToPageSpace(java.awt.Rectangle rect)
public void setSelectionRectangle(java.awt.Point cursorLocation,
java.awt.Rectangle selection)
setSelectionRectangle in class SelectionBoxHandler