public class

InkItem

extends Object
java.lang.Object
   ↳ com.pdftron.pdf.model.ink.InkItem
Known Direct Subclasses

Class Overview

Class used to describe all ink stroke related data.

Summary

Fields
public final float baseThickness
public final int color
public List<PointF> currentActiveStroke
public final List<List<PointF>> finishedStrokes
public final String id
public final boolean isStylus
public final float opacity
public final int pageNumber
public Paint paint
public float paintThickness
public List<PointF> previousStroke
public boolean shouldAnimateUndoRedo
Public Constructors
InkItem(String id, List<PointF> currentActiveStroke, List<List<PointF>> finishedStrokes, int pageNumber, int color, float opacity, float baseThickness, float paintThickness, boolean isStylus)
InkItem(int pageNumber, int color, float opacity, float baseThickness, boolean isStylus, PDFViewCtrl pdfViewCtrl)
Public Methods
void addPoint(float x, float y, float pressure, int action)
InkItem copy()
Create a copy of an InkItem and return it.
void draw(Canvas canvas, PDFViewCtrl pdfViewCtrl, Matrix transform, PointF offset)
When draw, we will lazy populate the paths for the finished strokes (this is done by converting page points via convPagePtToHorizontalScrollingPt).
boolean equals(Object obj)
Paint getPaint(PDFViewCtrl pdfViewCtrl)
int hashCode()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public final float baseThickness

public final int color

public List<PointF> currentActiveStroke

public final List<List<PointF>> finishedStrokes

public final String id

public final boolean isStylus

public final float opacity

public final int pageNumber

public Paint paint

public float paintThickness

public List<PointF> previousStroke

public boolean shouldAnimateUndoRedo

Public Constructors

public InkItem (String id, List<PointF> currentActiveStroke, List<List<PointF>> finishedStrokes, int pageNumber, int color, float opacity, float baseThickness, float paintThickness, boolean isStylus)

public InkItem (int pageNumber, int color, float opacity, float baseThickness, boolean isStylus, PDFViewCtrl pdfViewCtrl)

Public Methods

public void addPoint (float x, float y, float pressure, int action)

public InkItem copy ()

Create a copy of an InkItem and return it. Note that Paint is not copied as it's always lazy initialized

Returns
  • a new instance of InkItem.

public void draw (Canvas canvas, PDFViewCtrl pdfViewCtrl, Matrix transform, PointF offset)

When draw, we will lazy populate the paths for the finished strokes (this is done by converting page points via convPagePtToHorizontalScrollingPt). When the viewer zooms, we will need to delete the old paths and re-calculate/re-populate new paths.

public boolean equals (Object obj)

public Paint getPaint (PDFViewCtrl pdfViewCtrl)

public int hashCode ()