public abstract class

SimpleShapeCreate

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

Class Overview

This class is the base class for several shape creation classes, e.g., LineCreate, OvalCreate, etc.

Summary

[Expand]
Inherited Constants
From class com.pdftron.pdf.tools.Tool
Fields
protected final int START_DRAWING_THRESHOLD
protected int mDownPageNum
protected int mFillColor
protected Paint mFillPaint
protected boolean mHasFill
protected boolean mIsAllPointsOutsidePage
protected float mOpacity
protected RectF mPageCropOnClientF
protected Paint mPaint
protected PointF mPt1
protected PointF mPt2
protected int mStrokeColor
protected float mThickness
protected float mThicknessDraw
[Expand]
Inherited Fields
From class com.pdftron.pdf.tools.Tool
Public Constructors
SimpleShapeCreate(PDFViewCtrl ctrl)
Class constructor
Public Methods
abstract ToolManager.ToolModeBase getToolMode()
The overload interface of getToolMode() ()}.
boolean isCreatingAnnotation()
The overload implementation of isCreatingAnnotation().
void onConfigurationChanged(Configuration newConfig)
The overload implementation of onConfigurationChanged(Configuration).
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).
boolean onScaleBegin(float x, float y)
The overload implementation of onScaleBegin(float, float).
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, Rect bbox)
create markup annotation, called in onUp(MotionEvent, PDFViewCtrl.PriorEventMode)
void doneTwoFingerScrolling()
The overload implementation of doneTwoFingerScrolling().
int getCreateAnnotType()
Gets annot type when creating annotation.
ToolManager.ToolMode getDefaultNextTool()
Gets alternative next tool mode if next tool is not current tool By default, it is ToolMode.ANNOT_EDIT, if the alternative tool of subclass is not ToolMode.ANNOT_EDIT, then the subclass can override this method.
com.pdftron.pdf.Rect getShapeBBox()
void onCreateMarkupFailed(Exception e)
Called when creating markup annotaiton failed
void resetPts()
reset drawing pts
void setNextToolModeHelper()
set next tool mode helper
void setStyle(Annot annot, boolean hasFill)
Sets the style of the specified annotations as the current style
void setStyle(Annot annot)
Sets the style of the specified annotations as the current style
[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 final int START_DRAWING_THRESHOLD

Constant Value: 5 (0x00000005)

protected int mDownPageNum

protected int mFillColor

protected Paint mFillPaint

protected boolean mHasFill

protected boolean mIsAllPointsOutsidePage

protected float mOpacity

protected RectF mPageCropOnClientF

protected Paint mPaint

protected PointF mPt1

protected PointF mPt2

protected int mStrokeColor

protected float mThickness

protected float mThicknessDraw

Public Constructors

public SimpleShapeCreate (PDFViewCtrl ctrl)

Class constructor

Public Methods

public abstract ToolManager.ToolModeBase getToolMode ()

The overload interface of getToolMode() ()}.

Returns
  • the mode/identifier of this tool.

public boolean isCreatingAnnotation ()

The overload implementation of isCreatingAnnotation().

public void onConfigurationChanged (Configuration newConfig)

The overload implementation of onConfigurationChanged(Configuration).

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 boolean onScaleBegin (float x, float y)

The overload implementation of onScaleBegin(float, float).

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, Rect bbox)

create markup annotation, called in onUp(MotionEvent, PDFViewCtrl.PriorEventMode)

Parameters
doc PDF Document
bbox bounding box
Returns
  • Markup annotation
Throws
PDFNet exception
PDFNetException

protected void doneTwoFingerScrolling ()

The overload implementation of doneTwoFingerScrolling().

protected int getCreateAnnotType ()

Gets annot type when creating annotation.

Returns
  • annotation type

protected ToolManager.ToolMode getDefaultNextTool ()

Gets alternative next tool mode if next tool is not current tool By default, it is ToolMode.ANNOT_EDIT, if the alternative tool of subclass is not ToolMode.ANNOT_EDIT, then the subclass can override this method.

Returns
  • alternative next tool mode

protected com.pdftron.pdf.Rect getShapeBBox ()

Returns
  • The shape bounding box of the rubber band in page space

protected void onCreateMarkupFailed (Exception e)

Called when creating markup annotaiton failed

protected void resetPts ()

reset drawing pts

protected void setNextToolModeHelper ()

set next tool mode helper

protected void setStyle (Annot annot, boolean hasFill)

Sets the style of the specified annotations as the current style

Parameters
annot The annotation
hasFill True if has fill property

protected void setStyle (Annot annot)

Sets the style of the specified annotations as the current style

Parameters
annot The annotation