- java.lang.Object
-
- org.icepdf.ri.common.tools.CommonToolHandler
-
- org.icepdf.ri.common.tools.TextAnnotationHandler
-
- All Implemented Interfaces:
MouseListener,MouseMotionListener,EventListener,MouseInputListener,ToolHandler
public class TextAnnotationHandler extends CommonToolHandler implements ToolHandler
TextAnnotationHandler tool is responsible creating a new comment type TextAnnotation when a mouse click event is thrown on the page. The new TextAnnotation is placed at the point of the page where the click took place. The default icon state is set to comment and the respective PopupAnnotation is also created and shown.
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 static ColordefaultFillColorprotected static StringdefaultIconprotected static intdefaultOpacityprotected static DimensionICON_SIZE-
Fields inherited from class org.icepdf.ri.common.tools.CommonToolHandler
documentViewController, pageViewComponent, preferences
-
-
Constructor Summary
Constructors Constructor Description TextAnnotationHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)
-
Method Summary
-
Methods inherited from class org.icepdf.ri.common.tools.CommonToolHandler
convertToPageSpace, convertToPageSpace, convertToPageSpace, convertToPageSpace, getPageTransform, getPageTransform, getToPageSpaceTransform, getToPageSpaceTransform
-
-
-
-
Constructor Detail
-
TextAnnotationHandler
public TextAnnotationHandler(DocumentViewController documentViewController, AbstractPageViewComponent pageViewComponent)
-
-
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
-
mouseClicked
public void mouseClicked(MouseEvent e)
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
public void mousePressed(MouseEvent e)
- Specified by:
mousePressedin interfaceMouseListener
-
createTextAnnotation
public static TextAnnotation createTextAnnotation(Library library, Rectangle bbox, AffineTransform pageSpace)
-
createTextAnnotationInstance
public TextAnnotation createTextAnnotationInstance(Library library, Rectangle bbox, AffineTransform pageSpace)
-
createPopupAnnotation
public static PopupAnnotation createPopupAnnotation(Library library, Rectangle bbox, MarkupAnnotation parent, AffineTransform pageSpace, boolean isNew)
-
mouseReleased
public void mouseReleased(MouseEvent e)
- Specified by:
mouseReleasedin interfaceMouseListener
-
checkAndApplyPreferences
protected void checkAndApplyPreferences()
- Specified by:
checkAndApplyPreferencesin classCommonToolHandler
-
mouseEntered
public void mouseEntered(MouseEvent e)
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
public void mouseExited(MouseEvent e)
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseDragged
public void mouseDragged(MouseEvent e)
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseMoved
public void mouseMoved(MouseEvent e)
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
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
-
-