java.lang.Object | ||||
↳ | com.pdftron.pdf.tools.Tool | |||
↳ | com.pdftron.pdf.tools.BaseTool | |||
↳ | com.pdftron.pdf.tools.SimpleShapeCreate | |||
↳ | com.pdftron.pdf.tools.FreehandCreate |
Known Direct Subclasses |
This class is for creating a free hand annotation.
If mMultiStrokeMode is true, then each subsequent stroke will be added to the same annot.
If mTimedModeEnabled is true, then the strokes will be committed to the annot on a timer basis. This flag is only under effect if mMultiStrokeMode is true.
If mIsFromEditToolbar is true, then mMultiStrokeMode must be false and mTimedModeEnabled must be false.
# Test cases:
## Stylus as Pen: ### Invariants mTimedModeEnabled can be true or false mMultiStrokeMode can be true or false mIsEditingAnnot must be false ### Tests 1. mTimedModeEnabled = true and mMultiStrokeMode = true. A new annot should not be created each stroke, and strokes should be saved every 3 seconds. 2. mMultiStrokeMode = false. A new annot will be created after every stroke.
## Ink tool from toolbar: ### Invariants mTimedModeEnabled can be true or false mMultiStrokeMode can be true or false mIsEditingAnnot must be false ### Tests 1. mTimedModeEnabled = true and mMultiStrokeMode = true. A new annot should not be created each stroke, and strokes should be saved every 30 seconds. 2. mMultiStrokeMode = false. A new annot will be created after every stroke.
## Ink tool from quick menu: ### Invariants mTimedModeEnabled can be true or false mMultiStrokeMode must be true mIsEditingAnnot must be false 1. mTimedModeEnabled = true and mMultiStrokeMode = true. A new annot should not be created each stroke, and strokes should be saved every 30 seconds.
## Draw with finger setting
### 1. Draw with finger setting enabled: i. Enable stylus as pen setting and **enable** draw with finger setting. ii. Open a document and select the ink tool. iii. When you draw with the finger, ink should be created. However once you start drawing with the stylus, the finger should only pan.
### 2. Draw with finger setting disabled: i. Enable stylus as pen setting and **disable** draw with finger setting. ii. Open a document and select the ink tool. iii. When you draw with the finger, it should pan.
### 3. Stylus as pen setting disabled: i. Disable stylus as pen setting. ii. Open a document and select the ink tool. iii. When you draw with the finger, ink should be created. However once you start drawing with the stylus, the finger should only pan. Same as expected behavior 1.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pdftron.pdf.tools.SimpleShapeCreate
| |||||||||||
From class
com.pdftron.pdf.tools.BaseTool
| |||||||||||
From class
com.pdftron.pdf.tools.Tool
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static float | sSampleDelta |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pdftron.pdf.tools.Tool
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FreehandCreate(PDFViewCtrl ctrl)
Class constructor
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | canEraseStroke() | ||||||||||
boolean | canRedoStroke() | ||||||||||
boolean | canUndoStroke() | ||||||||||
void |
clearStrokes()
Clears all strokes.
| ||||||||||
void |
commitAnnotation()
Commits all changes to the annotation and resets this FreehandCreate object to
it's initial state.
| ||||||||||
static float | computeThresholdValue(View pdfViewCtrl) | ||||||||||
static List<List<PointF>> | createPageStrokesFromArrayObj(Obj strokesArray) | ||||||||||
static List<List<PointF>> | createStrokeListFromArrayObj(Obj strokesArray) | ||||||||||
int |
getCreateAnnotType()
Gets what annotation type this tool can create
| ||||||||||
String | getPressureSensitiveKey() | ||||||||||
ToolManager.ToolModeBase |
getToolMode()
The overload implementation of
getToolMode() . | ||||||||||
boolean |
isCreatingAnnotation()
The overload implementation of
isCreatingAnnotation() . | ||||||||||
void |
onClose()
The overload implementation of
onClose() . | ||||||||||
boolean |
onDoubleTap(MotionEvent e)
The overload implementation of
onDoubleTap(MotionEvent) . | ||||||||||
boolean |
onDoubleTapEvent(MotionEvent e)
The overload implementation of
onDoubleTapEvent(MotionEvent) . | ||||||||||
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) . | ||||||||||
void |
onRenderingFinished()
The overload implementation of
onRenderingFinished() . | ||||||||||
boolean |
onScaleBegin(float x, float y)
The overload implementation of
onScaleBegin(float, float) . | ||||||||||
boolean |
onUp(MotionEvent e, PDFViewCtrl.PriorEventMode priorEventMode)
The overload implementation of
onUp(MotionEvent, PDFViewCtrl.PriorEventMode) . | ||||||||||
void |
redoStroke()
Redoes the last undo.
| ||||||||||
void |
saveAnnotation()
Save the current ink strokes back to the annotation.
| ||||||||||
void |
setAllowTapToSelect(boolean allowTapToSelect)
Sets whether allow tap to select another annotation.
| ||||||||||
static void | setDebug(boolean debug) | ||||||||||
void |
setInitInkItem(Annot inkAnnot, int pageNum)
Initializes the ink item based on the specified annotation.
| ||||||||||
void |
setMultiStrokeMode(boolean mode)
Sets multiple stroke mode.
| ||||||||||
void |
setOnToolbarStateUpdateListener(OnToolbarStateUpdateListener listener)
Sets the
OnToolbarStateUpdateListener listener. | ||||||||||
void |
setPressureSensitive(boolean isPressureSensitive)
Sets whether the Ink annotation should be use pressure sensitive data.
| ||||||||||
void |
setTimedModeEnabled(boolean enabled)
Sets time mode.
| ||||||||||
void |
setupAnnotProperty(AnnotStyle annotStyle)
Setup annotation properties.
| ||||||||||
void |
setupAnnotProperty(int color, float opacity, float thickness, int fillColor, String icon, String pdfTronFontName)
The overload implementation of
setupAnnotProperty(int, float, float, int, String, String) . | ||||||||||
void |
setupEraserProperty(AnnotStyle annotStyle)
Setups eraser property.
| ||||||||||
void |
undoStroke()
Undoes the last stroke.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.pdftron.pdf.tools.SimpleShapeCreate
| |||||||||||
From class
com.pdftron.pdf.tools.BaseTool
| |||||||||||
From class
com.pdftron.pdf.tools.Tool
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
com.pdftron.pdf.tools.ToolManager.Tool
|
Clears all strokes.
Commits all changes to the annotation and resets this FreehandCreate object to it's initial state.
PDFNetException |
---|
PDFNetException |
---|
Gets what annotation type this tool can create
The overload implementation of getToolMode()
.
The overload implementation of onDoubleTapEvent(MotionEvent)
.
The overload implementation of onDraw(Canvas, Matrix)
.
The overload implementation of onMove(MotionEvent, MotionEvent, float, float)
.
The overload implementation of onScaleBegin(float, float)
.
The overload implementation of onUp(MotionEvent, PDFViewCtrl.PriorEventMode)
.
Redoes the last undo.
Save the current ink strokes back to the annotation. The tool can continue to be used to edit the current annotation.
Sets whether allow tap to select another annotation. Only allowed in single stroke mode.
allowTapToSelect | true if allow tap to select another annotation, dot will not be drawn. Default to false. |
---|
Initializes the ink item based on the specified annotation.
inkAnnot | The ink annotation |
---|---|
pageNum | The page number |
Sets multiple stroke mode.
mode | True if multiple stroke mode is enabled |
---|
Sets the OnToolbarStateUpdateListener
listener.
listener | the OnToolbarStateUpdateListener listener
|
---|
Sets whether the Ink annotation should be use pressure sensitive data. This is only available for devices that support capacitive touch screen that provide pressure data to MotionEvents.
By default Pressure Sensitivity is disabled.
isPressureSensitive | True if pressure sensitivity is enabled. |
---|
Sets time mode.
enabled | True if time mode is enabled |
---|
The overload implementation of setupAnnotProperty(int, float, float, int, String, String)
.
color | The color |
---|---|
opacity | The opacity |
thickness | The thickness |
fillColor | The color for filling |
icon | The icon |
pdfTronFontName | The PDFTron font name |
Setups eraser property.
annotStyle | The annot style |
---|
Undoes the last stroke.