java.lang.Object | |
↳ | com.pdftron.pdf.tools.Tool |
Known Direct Subclasses |
Known Indirect Subclasses |
The base class that implements the ToolManager.Tool interface and several basic tool functionalities.
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() | ||||||||||
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)
The overload implementation of
onDocumentDownloadEvent(PDFViewCtrl.DownloadState, int, int, int, String) . | ||||||||||
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
|
Check whether an annotation is part of a group annotation, proceed to select the group instead.
ToolManager.ToolMode
and the annotation group
that can then be used to select the group
Clears the target point.
Closes the quick menu
Executes an action with the specified parameters.
actionParam | The action parameters |
---|
Returns the PDFTron font name associated with the given font name.
context | used to get shared preferences. |
---|---|
fontName | font name mapped to a PDFTron font name. |
JSONException |
---|
Returns the annotation associated with this tool. This annotation should only be read with a read lock and should not be modified.
Gets what annotation type this tool can create
Returns the storage key string for font
annotType | The annotation type |
---|
Returns the storage key string for horizontal text alignment
annotType | The annotation type |
---|
The overload implementation of getNextToolMode()
.
Gets a rectangle to use when selecting text.
The overload implementation of getToolMode()
.
Returns the storage key string for vertical text alignment
annotType | The annotation type |
---|
Whether the current quick menu includes a certain menu type
menuId | the menu item id |
---|
Whether the purpose of this tool is editing annotation
Gets whether the mode that should forcefully remains.
Checks whether the specified point is inside the quick menu layout.
x | X coordinates |
---|---|
y | Y coordinates |
check if quick menu is showing
The overload implementation of onAnnotPainterUpdated(int, long, CurvePainter)
.
The overload implementation of onConfigurationChanged(Configuration)
.
Called after the tool is created by ToolManager.
The overload implementation of onDocumentDownloadEvent(PDFViewCtrl.DownloadState, int, int, int, String)
.
The overload implementation of onDoubleTapEnd(MotionEvent)
.
The overload implementation of onDoubleTapEvent(MotionEvent)
.
The overload implementation of onDoubleTapZoomAnimationBegin()
.
The overload implementation of onDoubleTapZoomAnimationEnd()
.
The overload implementation of onDraw(Canvas, Matrix)
.
The overload implementation of onDrawEdgeEffects(Canvas, int, int)
.
The overload implementation of onKeyUp(int, KeyEvent)
.
The overload implementation of onLayout(boolean, int, int, int, int)
.
The overload implementation of onMove(MotionEvent, MotionEvent, float, float)
.
The overload implementation of onNightModeUpdated(boolean)
.
The overload implementation of onPageTurning(int, int)
.
The overload implementation of onPointerDown(MotionEvent)
.
The overload implementation of onPullEdgeEffects(int, float)
.
Called when a menu in quick menu has been clicked.
menuItem | The clicked menu item. |
---|
The overload implementation of onScaleBegin(float, float)
.
The overload implementation of onScaleEnd(float, float)
.
The overload implementation of onScrollChanged(int, int, int, int)
.
The overload implementation of onSingleTapConfirmed(MotionEvent)
.
The overload implementation of onSingleTapUp(MotionEvent)
.
The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode)
.
Selects the specified annotation.
annot | The annotaion |
---|---|
pageNum | The page number where the annotaion is on |
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.
defaultToolMode | The current default tool mode |
---|
Specifies the mode that should forcefully remains.
Uses a helper to set the next tool mode.
nextToolMode | The next tool mode |
---|
Sets the visiblity of page number indicator.
visible | True if visibla |
---|
Setup annotation properties.
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 |
Setup annotation properties.
color | The color |
---|---|
opacity | The opacity |
thickness | The thickness |
fillColor | The color for filling |
icon | The icon |
pdfTronFontName | The PDFTron font name |
Shows the quick menu with given menu.
Shows the quick menu.
Updates font of widget. A write lock is expected around this method.
JSONException | |
---|---|
PDFNetException |
Update quick menu note text based on if the note has contents
note | the content of note |
---|
Update quick menu appearance item color