public abstract class

TextMarkupCreate

extends Tool
java.lang.Object
   ↳ com.pdftron.pdf.tools.Tool
     ↳ com.pdftron.pdf.tools.TextMarkupCreate
Known Direct Subclasses

Class Overview

This class is the base class for all text markup creation tools.

Summary

[Expand]
Inherited Constants
From class com.pdftron.pdf.tools.Tool
Fields
protected boolean mIsPointOutsidePage
[Expand]
Inherited Fields
From class com.pdftron.pdf.tools.Tool
Public Constructors
TextMarkupCreate(PDFViewCtrl ctrl)
Class constructor
Public Methods
int getCreateAnnotType()
Gets what annotation type this tool can create
abstract ToolManager.ToolModeBase getToolMode()
The overload implementation of getToolMode().
boolean isCreatingAnnotation()
The overload implementation of isCreatingAnnotation().
boolean onDown(MotionEvent e)
The overload implementation of onDown(MotionEvent).
void onDraw(Canvas canvas, Matrix tfm)
The overload implementation of onDraw(Canvas, Matrix).
boolean onFlingStop()
The overload implementation of onFlingStop().
boolean onMove(MotionEvent e1, MotionEvent e2, float x_dist, float y_dist)
The overload implementation of onMove(MotionEvent, MotionEvent, float, float).
boolean onQuickMenuClicked(QuickMenuItem menuItem)
When quick menu clicked, creates text markup annotation
boolean onSingleTapConfirmed(MotionEvent e)
The overload implementation of onSingleTapConfirmed(MotionEvent).
boolean onUp(MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)
The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode).
void setupAnnotProperty(int color, float opacity, float thickness, int fillColor, String icon, String pdfTronFontName)
Protected Methods
abstract Annot createMarkup(PDFDoc doc, com.pdftron.pdf.Rect bbox)
Creates a text markup.
void createTextMarkup()
void doneTwoFingerScrolling()
The overload implementation of doneTwoFingerScrolling().
static int getAnnotIndexForAddingMarkup(Page page)
Returns annotation index for adding markup.
boolean selectText(float x1, float y1, float x2, float y2, boolean byRect)
Selects text in the specified rectangle.
void setAnnotRect(Annot annot, com.pdftron.pdf.Rect rect, int pageNum)
Sets rectangle to annotation
[Expand]
Inherited Methods
From class com.pdftron.pdf.tools.Tool
From class java.lang.Object
From interface com.pdftron.pdf.tools.ToolManager.Tool

Fields

protected boolean mIsPointOutsidePage

Public Constructors

public TextMarkupCreate (PDFViewCtrl ctrl)

Class constructor

Public Methods

public int getCreateAnnotType ()

Gets what annotation type this tool can create

Returns
  • annot type for annotation creation tool, or unknown for non-creation tool.

public abstract ToolManager.ToolModeBase getToolMode ()

The overload implementation of getToolMode().

Returns
  • the mode/identifier of this tool.

public boolean isCreatingAnnotation ()

The overload implementation of isCreatingAnnotation().

public boolean onDown (MotionEvent e)

The overload implementation of onDown(MotionEvent).

public void onDraw (Canvas canvas, Matrix tfm)

The overload implementation of onDraw(Canvas, Matrix).

public boolean onFlingStop ()

The overload implementation of onFlingStop().

public boolean onMove (MotionEvent e1, MotionEvent e2, float x_dist, float y_dist)

The overload implementation of onMove(MotionEvent, MotionEvent, float, float).

public boolean onQuickMenuClicked (QuickMenuItem menuItem)

When quick menu clicked, creates text markup annotation

Parameters
menuItem The clicked menu item.
Returns
  • true if handled, else otherwise

public boolean onSingleTapConfirmed (MotionEvent e)

The overload implementation of onSingleTapConfirmed(MotionEvent).

public boolean onUp (MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)

The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode).

public void setupAnnotProperty (int color, float opacity, float thickness, int fillColor, String icon, String pdfTronFontName)

Parameters
color The color
opacity The opacity
thickness The thickness
fillColor The color for filling
icon The icon
pdfTronFontName The PDFTron font name

Protected Methods

protected abstract Annot createMarkup (PDFDoc doc, com.pdftron.pdf.Rect bbox)

Creates a text markup.

Parameters
doc The PDF doc
bbox The bounding box to create a markup
Returns
  • The created text markup
Throws
PDFNetException

protected void createTextMarkup ()

protected void doneTwoFingerScrolling ()

The overload implementation of doneTwoFingerScrolling().

protected static int getAnnotIndexForAddingMarkup (Page page)

Returns annotation index for adding markup.

Parameters
page The page
Returns
  • The annotation index

protected boolean selectText (float x1, float y1, float x2, float y2, boolean byRect)

Selects text in the specified rectangle.

Parameters
x1 The x coordinate at one of the end point of the rectangle
y1 The y coordinate at one of the end point of the rectangle
x2 The x coordinate at another point
y2 The y coordinate at another point
byRect True if should select by rectangle; false if should select by struct with smart snapping
Returns
  • True if some text was selected

protected void setAnnotRect (Annot annot, com.pdftron.pdf.Rect rect, int pageNum)

Sets rectangle to annotation

Parameters
annot The annotation
rect The rectangle area to set to annotation
pageNum The page number of annotation
Throws
PDFNetException