public class

FreeTextCreate

extends Tool
implements TextWatcher DialogAnnotNote.DialogAnnotNoteListener InlineEditText.InlineEditTextListener
java.lang.Object
   ↳ com.pdftron.pdf.tools.Tool
     ↳ com.pdftron.pdf.tools.FreeTextCreate
Known Direct Subclasses

Class Overview

A tool for creating free text annotation

Summary

Constants
boolean sUseEditTextAppearance
[Expand]
Inherited Constants
From class com.pdftron.pdf.tools.Tool
[Expand]
Inherited Fields
From class com.pdftron.pdf.tools.Tool
Public Constructors
FreeTextCreate(PDFViewCtrl ctrl)
Class constructor
Public Methods
void afterTextChanged(Editable s)
void beforeTextChanged(CharSequence s, int start, int count, int after)
static Rect calcFreeTextBBox(PDFViewCtrl pdfViewCtrl, FreeText freeText, int pageNum, boolean isRightToLeft, Point targetPoint)
int getCreateAnnotType()
Gets what annotation type this tool can create
static Rect getDefaultRect(FreeText freeText)
Returns the Rect containing coordinates for the default position of the FreeText, null if not available.
RectF getInlineEditTextPosition()
The overload implementation of getInlineEditTextPosition().
static Rect getRectUnion(Rect rect1, Rect rect2)
static Rect getTextBBoxOnPage(PDFViewCtrl pdfViewCtrl, int pageNum, Point targetPoint)
ToolManager.ToolModeBase getToolMode()
The overload implementation of getToolMode().
void initFreeText(PointF point)
Initializes the free text.
boolean isCreatingAnnotation()
The overload implementation of isCreatingAnnotation().
boolean isRichContentEnabled()
Gets whether rich content is enabled for the FreeText annotation
void onAnnotButtonPressed(int button)
The overload implementation of onAnnotButtonPressed(int).
void onClose()
The overload implementation of onClose().
void onConfigurationChanged(Configuration newConfig)
The overload implementation of onConfigurationChanged(Configuration).
void onCreate()
Called after the tool is created by ToolManager.
boolean onDown(MotionEvent e)
The overload implementation of onDown(MotionEvent).
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).
void onPageTurning(int old_page, int cur_page)
The overload implementation of onPageTurning(int, int).
void onRenderingFinished()
The overload implementation of onRenderingFinished().
boolean onScaleBegin(float x, float y)
The overload implementation of onScaleBegin(float, float).
void onTextChanged(CharSequence s, int start, int before, int count)
boolean onUp(MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)
The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode).
static void putDefaultRect(FreeText freeText, Rect defaultRect)
Used to set the coordinates for the default position of the FreeText as custom data in the annotation.
void setRichContentEnabled(boolean richContentEnabled)
Sets whether rich content is enabled for the FreeText annotation
void setupAnnotProperty(AnnotStyle annotStyle)
Setup annotation properties.
void toggleToFreeTextDialog(String interimText)
The overload implementation of toggleToFreeTextDialog(String).
[Expand]
Inherited Methods
From class com.pdftron.pdf.tools.Tool
From class java.lang.Object
From interface android.text.TextWatcher
From interface com.pdftron.pdf.tools.DialogAnnotNote.DialogAnnotNoteListener
From interface com.pdftron.pdf.tools.ToolManager.Tool
From interface com.pdftron.pdf.utils.InlineEditText.InlineEditTextListener

Constants

public static final boolean sUseEditTextAppearance

Constant Value: true

Public Constructors

public FreeTextCreate (PDFViewCtrl ctrl)

Class constructor

Public Methods

public void afterTextChanged (Editable s)

public void beforeTextChanged (CharSequence s, int start, int count, int after)

public static Rect calcFreeTextBBox (PDFViewCtrl pdfViewCtrl, FreeText freeText, int pageNum, boolean isRightToLeft, Point targetPoint)

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 static Rect getDefaultRect (FreeText freeText)

Returns the Rect containing coordinates for the default position of the FreeText, null if not available. See putDefaultRect(FreeText, Rect) for more info.

This method must be called in a read lock.

Parameters
freeText the FreeText annotation to get the default Rect
Returns
  • Rect containing the coordiantes for the default position of the FreeText, null if not available.

public RectF getInlineEditTextPosition ()

The overload implementation of getInlineEditTextPosition().

Returns
  • The position of the inline edit text

public static Rect getRectUnion (Rect rect1, Rect rect2)

public static Rect getTextBBoxOnPage (PDFViewCtrl pdfViewCtrl, int pageNum, Point targetPoint)

public ToolManager.ToolModeBase getToolMode ()

The overload implementation of getToolMode().

Returns
  • the mode/identifier of this tool.

public void initFreeText (PointF point)

Initializes the free text.

Parameters
point The new target point

public boolean isCreatingAnnotation ()

The overload implementation of isCreatingAnnotation().

public boolean isRichContentEnabled ()

Gets whether rich content is enabled for the FreeText annotation

public void onAnnotButtonPressed (int button)

The overload implementation of onAnnotButtonPressed(int).

Parameters
button The button ID. See android.content.DialogInterface

public void onClose ()

The overload implementation of onClose().

public void onConfigurationChanged (Configuration newConfig)

The overload implementation of onConfigurationChanged(Configuration).

public void onCreate ()

Called after the tool is created by ToolManager.

public boolean onDown (MotionEvent e)

The overload implementation of onDown(MotionEvent).

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 void onPageTurning (int old_page, int cur_page)

The overload implementation of onPageTurning(int, int).

public void onRenderingFinished ()

The overload implementation of onRenderingFinished().

public boolean onScaleBegin (float x, float y)

The overload implementation of onScaleBegin(float, float).

public void onTextChanged (CharSequence s, int start, int before, int count)

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

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

public static void putDefaultRect (FreeText freeText, Rect defaultRect)

Used to set the coordinates for the default position of the FreeText as custom data in the annotation. This custom data is used if isDeleteEmptyFreeText() is false and isAutoResizeFreeText() is true. When the FreeText has no text content (empty text), the FreeText resizes to return to the specified default size.

This method must be called in a write lock.

Parameters
freeText the FreeText annotation to add the default Rect
defaultRect the rect containing coordinates for the default position of the FreeText

public void setRichContentEnabled (boolean richContentEnabled)

Sets whether rich content is enabled for the FreeText annotation

public void setupAnnotProperty (AnnotStyle annotStyle)

Setup annotation properties.

public void toggleToFreeTextDialog (String interimText)

The overload implementation of toggleToFreeTextDialog(String).

Parameters
interimText The interim text