public abstract class

Tool

extends Object
implements ToolManager.Tool
java.lang.Object
   ↳ com.pdftron.pdf.tools.Tool
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

The base class that implements the ToolManager.Tool interface and several basic tool functionalities.

Summary

Constants
String ANNOTATION_FREE_TEXT_FONTS
String ANNOTATION_FREE_TEXT_JSON_FONT
String ANNOTATION_FREE_TEXT_JSON_FONT_DISPLAY_IN_LIST
String ANNOTATION_FREE_TEXT_JSON_FONT_DISPLAY_NAME
String ANNOTATION_FREE_TEXT_JSON_FONT_FILE_PATH
String ANNOTATION_FREE_TEXT_JSON_FONT_NAME
String ANNOTATION_FREE_TEXT_JSON_FONT_PDFTRON_NAME
int ANNOTATION_FREE_TEXT_PREFERENCE_DIALOG
String ANNOTATION_FREE_TEXT_PREFERENCE_EDITING
int ANNOTATION_FREE_TEXT_PREFERENCE_EDITING_DEFAULT
int ANNOTATION_FREE_TEXT_PREFERENCE_INLINE
String ANNOTATION_NOTE_ICON_FILE_POSTFIX_FILL
String ANNOTATION_NOTE_ICON_FILE_POSTFIX_OUTLINE
String ANNOTATION_NOTE_ICON_FILE_PREFIX
String ANNOTATION_TOOLBAR_SIGNATURE_STATE
int ANNOT_PERMISSION_FILL_AND_SIGN
int ANNOT_PERMISSION_INTERACT
int ANNOT_PERMISSION_MENU
int ANNOT_PERMISSION_SELECTION
String FLATTENED
String FORM_FIELD_SYMBOL_CHECKBOX
String FORM_FIELD_SYMBOL_CIRCLE
String FORM_FIELD_SYMBOL_CROSS
String FORM_FIELD_SYMBOL_DIAMOND
String FORM_FIELD_SYMBOL_SQUARE
String FORM_FIELD_SYMBOL_STAR
String IS_LINK
String KEYS
String LAST_DEVICE_LOCALE_LANGUAGE
String LINK_RECTF
String LINK_URL
String METHOD_FROM
String PAGE_NUMBER
String PDFTRON_ID
String PDFTRON_THICKNESS
String PREF_ANNOTATION_CREATION_ARROW
String PREF_ANNOTATION_CREATION_CLOUD
String PREF_ANNOTATION_CREATION_COLOR
String PREF_ANNOTATION_CREATION_ERASER
String PREF_ANNOTATION_CREATION_FILL_COLOR
String PREF_ANNOTATION_CREATION_FONT
String PREF_ANNOTATION_CREATION_FREEHAND
String PREF_ANNOTATION_CREATION_FREETEXT
String PREF_ANNOTATION_CREATION_FREE_HIGHLIGHTER
String PREF_ANNOTATION_CREATION_HIGHLIGHT
String PREF_ANNOTATION_CREATION_ICON
String PREF_ANNOTATION_CREATION_LINE
String PREF_ANNOTATION_CREATION_LINK
String PREF_ANNOTATION_CREATION_NOTE
String PREF_ANNOTATION_CREATION_OPACITY
String PREF_ANNOTATION_CREATION_OVAL
String PREF_ANNOTATION_CREATION_POLYGON
String PREF_ANNOTATION_CREATION_POLYLINE
String PREF_ANNOTATION_CREATION_RECTANGLE
String PREF_ANNOTATION_CREATION_SIGNATURE
String PREF_ANNOTATION_CREATION_SQUIGGLY
String PREF_ANNOTATION_CREATION_STRIKEOUT
String PREF_ANNOTATION_CREATION_TEXT_COLOR
String PREF_ANNOTATION_CREATION_TEXT_SIZE
String PREF_ANNOTATION_CREATION_THICKNESS
String PREF_ANNOTATION_CREATION_UNDERLINE
String PREF_TRANSLATION_SOURCE_LANGUAGE_CODE_DEFAULT
String PREF_TRANSLATION_SOURCE_LANGUAGE_CODE_KEY
String PREF_TRANSLATION_TARGET_LANGUAGE_CODE_DEFAULT
String PREF_TRANSLATION_TARGET_LANGUAGE_CODE_KEY
int QM_MAX_ROW_SIZE
String STAMP_SHOW_FLATTEN_WARNING
Fields
public static final String[] ANNOTATION_FREE_TEXT_WHITELIST_FONTS
Public Constructors
Tool(PDFViewCtrl ctrl)
Class constructor
Public Methods
void backToDefaultTool()
static Pair<ToolManager.ToolMode, ArrayList<Annot>> canSelectGroupAnnot(PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum)
Check whether an annotation is part of a group annotation, proceed to select the group instead.
void clearTargetPoint()
Clears the target point.
void closeQuickMenu()
Closes the quick menu
void executeAction(ActionParameter actionParam)
Executes an action with the specified parameters.
static String findPDFTronFontName(Context context, String fontName)
Returns the PDFTron font name associated with the given font name.
Annot getAnnot()
Returns the annotation associated with this tool.
static Bundle getAnnotationModificationBundle(Bundle bundle)
Bundle getBundle()
abstract int getCreateAnnotType()
Gets what annotation type this tool can create
ToolManager.ToolModeBase getCurrentDefaultToolMode()
static String getFontKey(int annotType)
Returns the storage key string for font
static String getHorizontalAlignmentKey(int annotType)
Returns the storage key string for horizontal text alignment
final ToolManager.ToolModeBase getNextToolMode()
The overload implementation of getNextToolMode().
boolean getSnappingEnabled()
static RectF getTextSelectRect(float x, float y)
Gets a rectangle to use when selecting text.
abstract ToolManager.ToolModeBase getToolMode()
The overload implementation of getToolMode().
static SharedPreferences getToolPreferences(Context context)
static String getVerticalAlignmentKey(int annotType)
Returns the storage key string for vertical text alignment
boolean hasAnnotSelected()
boolean hasMenuEntry(int menuId)
Whether the current quick menu includes a certain menu type
boolean isCreatingAnnotation()
The overload implementation of isCreatingAnnotation().
boolean isEditAnnotTool()
Whether the purpose of this tool is editing annotation
boolean isEditingAnnot()
boolean isForceSameNextToolMode()
Gets whether the mode that should forcefully remains.
boolean isInsideQuickMenu(float x, float y)
Checks whether the specified point is inside the quick menu layout.
boolean isQuickMenuShown()
check if quick menu is showing
void onAnnotPainterUpdated(int page, long which, CurvePainter painter)
The overload implementation of onAnnotPainterUpdated(int, long, CurvePainter).
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.
void onCustomEvent(Object o)
The overload implementation of onCustomEvent(Object).
void onDocumentDownloadEvent(PDFViewCtrl.DownloadState state, int page_num, int page_downloaded, int page_count, String message)
boolean onDoubleTap(MotionEvent e)
The overload implementation of onDoubleTap(MotionEvent).
void onDoubleTapEnd(MotionEvent e)
The overload implementation of onDoubleTapEnd(MotionEvent).
boolean onDoubleTapEvent(MotionEvent e)
The overload implementation of onDoubleTapEvent(MotionEvent).
void onDoubleTapZoomAnimationBegin()
The overload implementation of onDoubleTapZoomAnimationBegin().
void onDoubleTapZoomAnimationEnd()
The overload implementation of onDoubleTapZoomAnimationEnd().
boolean onDown(MotionEvent e)
The overload implementation of onDown(MotionEvent).
void onDraw(Canvas canvas, Matrix tfm)
The overload implementation of onDraw(Canvas, Matrix).
boolean onDrawEdgeEffects(Canvas canvas, int width, int verticalOffset)
The overload implementation of onDrawEdgeEffects(Canvas, int, int).
boolean onFlingStop()
The overload implementation of onFlingStop().
boolean onKeyUp(int keyCode, KeyEvent event)
The overload implementation of onKeyUp(int, KeyEvent).
void onLayout(boolean changed, int l, int t, int r, int b)
The overload implementation of onLayout(boolean, int, int, int, int).
boolean onLongPress(MotionEvent e)
The overload implementation of onLongPress(MotionEvent).
boolean onMove(MotionEvent e1, MotionEvent e2, float x_dist, float y_dist)
The overload implementation of onMove(MotionEvent, MotionEvent, float, float).
void onNightModeUpdated(boolean isNightMode)
The overload implementation of onNightModeUpdated(boolean).
void onPageTurning(int old_page, int cur_page)
The overload implementation of onPageTurning(int, int).
boolean onPointerDown(MotionEvent e)
The overload implementation of onPointerDown(MotionEvent).
void onPostSingleTapConfirmed()
The overload implementation of onPostSingleTapConfirmed().
void onPullEdgeEffects(int whichEdge, float deltaDistance)
The overload implementation of onPullEdgeEffects(int, float).
boolean onQuickMenuClicked(QuickMenuItem menuItem)
Called when a menu in quick menu has been clicked.
void onReleaseEdgeEffects()
The overload implementation of onReleaseEdgeEffects().
void onRenderingFinished()
The overload implementation of onRenderingFinished().
boolean onScale(float x, float y)
The overload implementation of onScale(float, float).
boolean onScaleBegin(float x, float y)
The overload implementation of onScaleBegin(float, float).
boolean onScaleEnd(float x, float y)
The overload implementation of onScaleEnd(float, float).
void onScrollChanged(int l, int t, int oldl, int oldt)
The overload implementation of onScrollChanged(int, int, int, int).
void onSetDoc()
The overload implementation of onSetDoc().
boolean onShowPress(MotionEvent e)
The overload implementation of onShowPress(MotionEvent).
boolean onSingleTapConfirmed(MotionEvent e)
The overload implementation of onSingleTapConfirmed(MotionEvent).
boolean onSingleTapUp(MotionEvent e)
The overload implementation of onSingleTapUp(MotionEvent).
boolean onUp(MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)
The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode).
void selectAnnot(Annot annot, int pageNum)
Selects the specified annotation.
static void setAuthorForAnnot(ToolManager toolManager, Markup annot)
void setCurrentDefaultToolModeHelper(ToolManager.ToolModeBase defaultToolMode)
Uses a helper to set current default tool mode.
static void setDebug(boolean debug)
void setForceSameNextToolMode(boolean mode)
Specifies the mode that should forcefully remains.
void setNextToolModeHelper(ToolManager.ToolMode nextToolMode)
Uses a helper to set the next tool mode.
void setPageNumberIndicatorVisible(boolean visible)
Sets the visiblity of page number indicator.
void setSnappingEnabled(boolean enabled)
void setupAnnotProperty(int color, float opacity, float thickness, int fillColor, String icon, String pdfTronFontName, int textColor, float textSize)
Setup annotation properties.
void setupAnnotProperty(AnnotStyle annotStyle)
Setup annotation properties.
void setupAnnotProperty(int color, float opacity, float thickness, int fillColor, String icon, String pdfTronFontName)
Setup annotation properties.
void setupAnnotStyles(ArrayList<AnnotStyle> annotStyles)
boolean showMenu(RectF anchor_rect, QuickMenu quickMenu)
Shows the quick menu with given menu.
boolean showMenu(RectF anchor_rect)
Shows the quick menu.
static void updateFont(PDFViewCtrl pdfViewCtrl, Widget widget, String contents)
Updates font of widget.
static void updateFontMap(Context context, int annotType, String pdfFontName, String fontName)
void updateQuickMenuNoteText(String note)
Update quick menu note text based on if the note has contents
void updateQuickMenuStyleColor(int color)
Update quick menu appearance item color
void updateQuickMenuStyleOpacity(float opacity)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pdftron.pdf.tools.ToolManager.Tool

Constants

public static final String ANNOTATION_FREE_TEXT_FONTS

Constant Value: "annotation_property_free_text_fonts_list"

public static final String ANNOTATION_FREE_TEXT_JSON_FONT

Constant Value: "fonts"

public static final String ANNOTATION_FREE_TEXT_JSON_FONT_DISPLAY_IN_LIST

Constant Value: "display font"

public static final String ANNOTATION_FREE_TEXT_JSON_FONT_DISPLAY_NAME

Constant Value: "display name"

public static final String ANNOTATION_FREE_TEXT_JSON_FONT_FILE_PATH

Constant Value: "filepath"

public static final String ANNOTATION_FREE_TEXT_JSON_FONT_NAME

Constant Value: "font name"

public static final String ANNOTATION_FREE_TEXT_JSON_FONT_PDFTRON_NAME

Constant Value: "pdftron name"

public static final int ANNOTATION_FREE_TEXT_PREFERENCE_DIALOG

Constant Value: 2 (0x00000002)

public static final String ANNOTATION_FREE_TEXT_PREFERENCE_EDITING

Constant Value: "annotation_free_text_preference_editing"

public static final int ANNOTATION_FREE_TEXT_PREFERENCE_EDITING_DEFAULT

Constant Value: 1 (0x00000001)

public static final int ANNOTATION_FREE_TEXT_PREFERENCE_INLINE

Constant Value: 1 (0x00000001)

public static final String ANNOTATION_NOTE_ICON_FILE_POSTFIX_FILL

Constant Value: "_fill"

public static final String ANNOTATION_NOTE_ICON_FILE_POSTFIX_OUTLINE

Constant Value: "_outline"

public static final String ANNOTATION_NOTE_ICON_FILE_PREFIX

Constant Value: "annotation_note_icon_"

public static final String ANNOTATION_TOOLBAR_SIGNATURE_STATE

Constant Value: "annotation_toolbar_signature_state"

public static final int ANNOT_PERMISSION_FILL_AND_SIGN

Constant Value: 2 (0x00000002)

public static final int ANNOT_PERMISSION_INTERACT

Constant Value: 3 (0x00000003)

public static final int ANNOT_PERMISSION_MENU

Constant Value: 1 (0x00000001)

public static final int ANNOT_PERMISSION_SELECTION

Constant Value: 0 (0x00000000)

public static final String FLATTENED

Constant Value: "flattened"

public static final String FORM_FIELD_SYMBOL_CHECKBOX

Constant Value: "4"

public static final String FORM_FIELD_SYMBOL_CIRCLE

Constant Value: "l"

public static final String FORM_FIELD_SYMBOL_CROSS

Constant Value: "8"

public static final String FORM_FIELD_SYMBOL_DIAMOND

Constant Value: "u"

public static final String FORM_FIELD_SYMBOL_SQUARE

Constant Value: "n"

public static final String FORM_FIELD_SYMBOL_STAR

Constant Value: "H"

public static final String IS_LINK

Constant Value: "IS_LINK"

public static final String KEYS

Constant Value: "PDFTRON_KEYS"

public static final String LAST_DEVICE_LOCALE_LANGUAGE

Constant Value: "last_device_locale_language"

public static final String LINK_RECTF

Constant Value: "LINK_RECTF"

public static final String LINK_URL

Constant Value: "LINK_URL"

public static final String METHOD_FROM

Constant Value: "METHOD_FROM"

public static final String PAGE_NUMBER

Constant Value: "PAGE_NUMBER"

public static final String PDFTRON_ID

Constant Value: "pdftron"

public static final String PDFTRON_THICKNESS

Constant Value: "pdftron_thickness"

public static final String PREF_ANNOTATION_CREATION_ARROW

Constant Value: "annotation_creation_arrow"

public static final String PREF_ANNOTATION_CREATION_CLOUD

Constant Value: "annotation_creation_cloud"

public static final String PREF_ANNOTATION_CREATION_COLOR

Constant Value: "_color"

public static final String PREF_ANNOTATION_CREATION_ERASER

Constant Value: "annotation_creation_eraser"

public static final String PREF_ANNOTATION_CREATION_FILL_COLOR

Constant Value: "_fill_color"

public static final String PREF_ANNOTATION_CREATION_FONT

Constant Value: "_font"

public static final String PREF_ANNOTATION_CREATION_FREEHAND

Constant Value: "annotation_creation_freehand"

public static final String PREF_ANNOTATION_CREATION_FREETEXT

Constant Value: "annotation_creation_freetext"

public static final String PREF_ANNOTATION_CREATION_FREE_HIGHLIGHTER

Constant Value: "annotation_creation_free_highlighter"

public static final String PREF_ANNOTATION_CREATION_HIGHLIGHT

Constant Value: "annotation_creation_highlight"

public static final String PREF_ANNOTATION_CREATION_ICON

Constant Value: "_icon"

public static final String PREF_ANNOTATION_CREATION_LINE

Constant Value: "annotation_creation"

public static final String PREF_ANNOTATION_CREATION_LINK

Constant Value: "annotation_creation_link"

public static final String PREF_ANNOTATION_CREATION_NOTE

Constant Value: "annotation_creation_note"

public static final String PREF_ANNOTATION_CREATION_OPACITY

Constant Value: "_opacity"

public static final String PREF_ANNOTATION_CREATION_OVAL

Constant Value: "annotation_creation_oval"

public static final String PREF_ANNOTATION_CREATION_POLYGON

Constant Value: "annotation_creation_polygon"

public static final String PREF_ANNOTATION_CREATION_POLYLINE

Constant Value: "annotation_creation_polyline"

public static final String PREF_ANNOTATION_CREATION_RECTANGLE

Constant Value: "annotation_creation_rectangle"

public static final String PREF_ANNOTATION_CREATION_SIGNATURE

Constant Value: "annotation_creation_signature"

public static final String PREF_ANNOTATION_CREATION_SQUIGGLY

Constant Value: "annotation_creation_squiggly"

public static final String PREF_ANNOTATION_CREATION_STRIKEOUT

Constant Value: "annotation_creation_strikeout"

public static final String PREF_ANNOTATION_CREATION_TEXT_COLOR

Constant Value: "_text_color"

public static final String PREF_ANNOTATION_CREATION_TEXT_SIZE

Constant Value: "_text_size"

public static final String PREF_ANNOTATION_CREATION_THICKNESS

Constant Value: "_thickness"

public static final String PREF_ANNOTATION_CREATION_UNDERLINE

Constant Value: "annotation_creation_text_markup"

public static final String PREF_TRANSLATION_SOURCE_LANGUAGE_CODE_DEFAULT

Constant Value: "en"

public static final String PREF_TRANSLATION_SOURCE_LANGUAGE_CODE_KEY

Constant Value: "translation_source_language_code"

public static final String PREF_TRANSLATION_TARGET_LANGUAGE_CODE_DEFAULT

Constant Value: "fr"

public static final String PREF_TRANSLATION_TARGET_LANGUAGE_CODE_KEY

Constant Value: "translation_target_language_code"

public static final int QM_MAX_ROW_SIZE

Constant Value: 4 (0x00000004)

public static final String STAMP_SHOW_FLATTEN_WARNING

Constant Value: "stamp_show_flatten_warning"

Fields

public static final String[] ANNOTATION_FREE_TEXT_WHITELIST_FONTS

Public Constructors

public Tool (PDFViewCtrl ctrl)

Class constructor

Public Methods

public void backToDefaultTool ()

public static Pair<ToolManager.ToolMode, ArrayList<Annot>> canSelectGroupAnnot (PDFViewCtrl pdfViewCtrl, Annot annot, int pageNum)

Check whether an annotation is part of a group annotation, proceed to select the group instead.

Returns
  • null if no such group found, otherwise returns the Pair of ToolManager.ToolMode and the annotation group that can then be used to select the group

public void clearTargetPoint ()

Clears the target point.

public void closeQuickMenu ()

Closes the quick menu

public void executeAction (ActionParameter actionParam)

Executes an action with the specified parameters.

Note that the PDF doc should have been locked when call this method. In addition, ToolManager's raise annotation should be handled in the caller function.

Parameters
actionParam The action parameters

public static String findPDFTronFontName (Context context, String fontName)

Returns the PDFTron font name associated with the given font name.

Parameters
context used to get shared preferences.
fontName font name mapped to a PDFTron font name.
Returns
  • the PDFTron font name, or empty string if not available.
Throws
JSONException

public Annot getAnnot ()

Returns the annotation associated with this tool. This annotation should only be read with a read lock and should not be modified.

public static Bundle getAnnotationModificationBundle (Bundle bundle)

public Bundle getBundle ()

public abstract int getCreateAnnotType ()

Gets what annotation type this tool can create

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

public ToolManager.ToolModeBase getCurrentDefaultToolMode ()

Returns
  • The current default tool mode

public static String getFontKey (int annotType)

Returns the storage key string for font

Parameters
annotType The annotation type
Returns
  • The storage key string

public static String getHorizontalAlignmentKey (int annotType)

Returns the storage key string for horizontal text alignment

Parameters
annotType The annotation type
Returns
  • The storage key string

public final ToolManager.ToolModeBase getNextToolMode ()

The overload implementation of getNextToolMode().

Returns
  • the mode of the next tool. Via this method, a tool can indicate the next tool to switch to.

public boolean getSnappingEnabled ()

public static RectF getTextSelectRect (float x, float y)

Gets a rectangle to use when selecting text.

public abstract ToolManager.ToolModeBase getToolMode ()

The overload implementation of getToolMode().

Returns
  • the mode/identifier of this tool.

public static SharedPreferences getToolPreferences (Context context)

public static String getVerticalAlignmentKey (int annotType)

Returns the storage key string for vertical text alignment

Parameters
annotType The annotation type
Returns
  • The storage key string

public boolean hasAnnotSelected ()

public boolean hasMenuEntry (int menuId)

Whether the current quick menu includes a certain menu type

Parameters
menuId the menu item id

public boolean isCreatingAnnotation ()

The overload implementation of isCreatingAnnotation().

public boolean isEditAnnotTool ()

Whether the purpose of this tool is editing annotation

Returns
  • false

public boolean isEditingAnnot ()

Returns
  • True if the annotation is editing

public boolean isForceSameNextToolMode ()

Gets whether the mode that should forcefully remains.

public boolean isInsideQuickMenu (float x, float y)

Checks whether the specified point is inside the quick menu layout.

Parameters
x X coordinates
y Y coordinates
Returns
  • True if it is inside quick menu, false otherwise

public boolean isQuickMenuShown ()

check if quick menu is showing

Returns
  • true if quick menu is visible

public void onAnnotPainterUpdated (int page, long which, CurvePainter painter)

The overload implementation of onAnnotPainterUpdated(int, long, CurvePainter).

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 void onCustomEvent (Object o)

The overload implementation of onCustomEvent(Object).

public void onDocumentDownloadEvent (PDFViewCtrl.DownloadState state, int page_num, int page_downloaded, int page_count, String message)

public boolean onDoubleTap (MotionEvent e)

The overload implementation of onDoubleTap(MotionEvent).

public void onDoubleTapEnd (MotionEvent e)

The overload implementation of onDoubleTapEnd(MotionEvent).

public boolean onDoubleTapEvent (MotionEvent e)

The overload implementation of onDoubleTapEvent(MotionEvent).

public void onDoubleTapZoomAnimationBegin ()

The overload implementation of onDoubleTapZoomAnimationBegin().

public void onDoubleTapZoomAnimationEnd ()

The overload implementation of onDoubleTapZoomAnimationEnd().

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 onDrawEdgeEffects (Canvas canvas, int width, int verticalOffset)

The overload implementation of onDrawEdgeEffects(Canvas, int, int).

public boolean onFlingStop ()

The overload implementation of onFlingStop().

public boolean onKeyUp (int keyCode, KeyEvent event)

The overload implementation of onKeyUp(int, KeyEvent).

public void onLayout (boolean changed, int l, int t, int r, int b)

The overload implementation of onLayout(boolean, int, int, int, int).

public boolean onLongPress (MotionEvent e)

The overload implementation of onLongPress(MotionEvent).

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

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

public void onNightModeUpdated (boolean isNightMode)

The overload implementation of onNightModeUpdated(boolean).

public void onPageTurning (int old_page, int cur_page)

The overload implementation of onPageTurning(int, int).

public boolean onPointerDown (MotionEvent e)

The overload implementation of onPointerDown(MotionEvent).

public void onPostSingleTapConfirmed ()

The overload implementation of onPostSingleTapConfirmed().

public void onPullEdgeEffects (int whichEdge, float deltaDistance)

The overload implementation of onPullEdgeEffects(int, float).

public boolean onQuickMenuClicked (QuickMenuItem menuItem)

Called when a menu in quick menu has been clicked.

Parameters
menuItem The clicked menu item.
Returns
  • True if handled

public void onReleaseEdgeEffects ()

The overload implementation of onReleaseEdgeEffects().

public void onRenderingFinished ()

The overload implementation of onRenderingFinished().

public boolean onScale (float x, float y)

The overload implementation of onScale(float, float).

public boolean onScaleBegin (float x, float y)

The overload implementation of onScaleBegin(float, float).

public boolean onScaleEnd (float x, float y)

The overload implementation of onScaleEnd(float, float).

public void onScrollChanged (int l, int t, int oldl, int oldt)

The overload implementation of onScrollChanged(int, int, int, int).

public void onSetDoc ()

The overload implementation of onSetDoc().

public boolean onShowPress (MotionEvent e)

The overload implementation of onShowPress(MotionEvent).

public boolean onSingleTapConfirmed (MotionEvent e)

The overload implementation of onSingleTapConfirmed(MotionEvent).

public boolean onSingleTapUp (MotionEvent e)

The overload implementation of onSingleTapUp(MotionEvent).

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

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

public void selectAnnot (Annot annot, int pageNum)

Selects the specified annotation.

Parameters
annot The annotaion
pageNum The page number where the annotaion is on

public static void setAuthorForAnnot (ToolManager toolManager, Markup annot)

public void setCurrentDefaultToolModeHelper (ToolManager.ToolModeBase defaultToolMode)

Uses a helper to set current default tool mode. This flag is used for a creation tool to go into editing tool then go back to the original creation tool.

Parameters
defaultToolMode The current default tool mode

public static void setDebug (boolean debug)

public void setForceSameNextToolMode (boolean mode)

Specifies the mode that should forcefully remains.

public void setNextToolModeHelper (ToolManager.ToolMode nextToolMode)

Uses a helper to set the next tool mode.

Parameters
nextToolMode The next tool mode

public void setPageNumberIndicatorVisible (boolean visible)

Sets the visiblity of page number indicator.

Parameters
visible True if visibla

public void setSnappingEnabled (boolean enabled)

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

Setup annotation properties.

Parameters
color The color
opacity The opacity
thickness The thickness
fillColor The color for filling
icon The icon
pdfTronFontName The PDFTron font name
textColor The text color
textSize The text size

public void setupAnnotProperty (AnnotStyle annotStyle)

Setup annotation properties.

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

Setup annotation properties.

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

public void setupAnnotStyles (ArrayList<AnnotStyle> annotStyles)

public boolean showMenu (RectF anchor_rect, QuickMenu quickMenu)

Shows the quick menu with given menu.

public boolean showMenu (RectF anchor_rect)

Shows the quick menu.

public static void updateFont (PDFViewCtrl pdfViewCtrl, Widget widget, String contents)

Updates font of widget. A write lock is expected around this method.

Throws
JSONException
PDFNetException

public static void updateFontMap (Context context, int annotType, String pdfFontName, String fontName)

public void updateQuickMenuNoteText (String note)

Update quick menu note text based on if the note has contents

Parameters
note the content of note

public void updateQuickMenuStyleColor (int color)

Update quick menu appearance item color

public void updateQuickMenuStyleOpacity (float opacity)