- java.lang.Object
-
- org.icepdf.ri.common.tools.CommonToolHandler
-
- org.icepdf.ri.common.tools.InkAnnotationHandler
-
- All Implemented Interfaces:
ActionListener,MouseListener,MouseMotionListener,EventListener,MouseInputListener,ToolHandler
public class InkAnnotationHandler extends CommonToolHandler implements ToolHandler, ActionListener
InkAnnotationHandler tool is responsible for painting representation of an ink on the screen as the mouse is dragged around the page. The points that make up the mouse path are then used to create the InkAnnotation and respective annotation component.
The addition of the Annotation object to the page is handled by the annotation callback.- Since:
- 5.0
-
-
Field Summary
Fields Modifier and Type Field Description protected BorderStyleborderStyleprotected static ColorinkColorprotected GeneralPathinkPathprotected static intopacityprotected static BasicStrokestroke-
Fields inherited from class org.icepdf.ri.common.tools.CommonToolHandler
documentViewController, pageViewComponent, preferences
-
-
Constructor Summary
Constructors Constructor Description InkAnnotationHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)New Text selection handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactionPerformed(ActionEvent actionEvent)protected voidbuildInkAnnotation()protected voidcheckAndApplyPreferences()voidinstallTool()Callback code that allows post construct task to take place when the tool is selected via theAbstractDocumentView.setToolMode(int)call.voidmouseClicked(MouseEvent e)voidmouseDragged(MouseEvent e)voidmouseEntered(MouseEvent e)voidmouseExited(MouseEvent e)voidmouseMoved(MouseEvent e)voidmousePressed(MouseEvent e)voidmouseReleased(MouseEvent e)voidpaintTool(Graphics g)Paints the tools pre-annotation creation state.voiduninstallTool()Callback code that allows pre destroy task to take place when the tool is unselected via theAbstractDocumentView.setToolMode(int)call.-
Methods inherited from class org.icepdf.ri.common.tools.CommonToolHandler
convertToPageSpace, convertToPageSpace, convertToPageSpace, convertToPageSpace, getPageTransform, getPageTransform, getToPageSpaceTransform, getToPageSpaceTransform
-
-
-
-
Field Detail
-
stroke
protected static final BasicStroke stroke
-
inkColor
protected static Color inkColor
-
opacity
protected static int opacity
-
inkPath
protected GeneralPath inkPath
-
borderStyle
protected final BorderStyle borderStyle
-
-
Constructor Detail
-
InkAnnotationHandler
public InkAnnotationHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)
New Text selection handler. Make sure to correctly and remove this mouse and text listeners.- Parameters:
pageViewComponent- page component that this handler is bound to.documentViewController- parent document view controller.
-
-
Method Detail
-
paintTool
public void paintTool(Graphics g)
Description copied from interface:ToolHandlerPaints the tools pre-annotation creation state.- Specified by:
paintToolin interfaceToolHandler- Parameters:
g- graphics context
-
checkAndApplyPreferences
protected void checkAndApplyPreferences()
- Specified by:
checkAndApplyPreferencesin classCommonToolHandler
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
actionPerformed
public void actionPerformed(ActionEvent actionEvent)
- Specified by:
actionPerformedin interfaceActionListener
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExitedin interfaceMouseListener
-
installTool
public void installTool()
Description copied from interface:ToolHandlerCallback code that allows post construct task to take place when the tool is selected via theAbstractDocumentView.setToolMode(int)call.- Specified by:
installToolin interfaceToolHandler
-
uninstallTool
public void uninstallTool()
Description copied from interface:ToolHandlerCallback code that allows pre destroy task to take place when the tool is unselected via theAbstractDocumentView.setToolMode(int)call.- Specified by:
uninstallToolin interfaceToolHandler
-
buildInkAnnotation
protected void buildInkAnnotation()
-
-