public class

PolygonAnnotation

extends BaseLineAnnotation
java.lang.Object
   ↳ com.pspdfkit.annotations.Annotation
     ↳ com.pspdfkit.annotations.ShapeAnnotation
       ↳ com.pspdfkit.annotations.BaseLineAnnotation
         ↳ com.pspdfkit.annotations.PolygonAnnotation

Class Overview

Represents a closed polygon on a page.

Summary

[Expand]
Inherited Constants
From class com.pspdfkit.annotations.Annotation
[Expand]
Inherited Fields
From class com.pspdfkit.annotations.Annotation
Public Constructors
PolygonAnnotation(int pageIndex, List<PointF> points)
Creates a new polygon annotation.
Public Methods
List<PointF> getPoints()
Returns polygon points in PDF coordinates.
AnnotationType getType()
Gets the annotation type of the annotation.
void setPoints(List<PointF> points)
Sets polygon points in PDF coordinates.
Protected Methods
Pair<LineEndTypeLineEndType> getLineEnds()
Returns current line ending styles for this line.
[Expand]
Inherited Methods
From class com.pspdfkit.annotations.BaseLineAnnotation
From class com.pspdfkit.annotations.ShapeAnnotation
From class com.pspdfkit.annotations.Annotation
From class java.lang.Object

Public Constructors

public PolygonAnnotation (int pageIndex, List<PointF> points)

Creates a new polygon annotation.

Parameters
pageIndex Page to which this annotation will be attached to.
points List of points in polygon annotation.

Public Methods

public List<PointF> getPoints ()

Returns polygon points in PDF coordinates.

Returns
  • List of polygon points. If for any reason valid coordinates aren't set, returns (0, 0) points.

public AnnotationType getType ()

Gets the annotation type of the annotation.

Returns
  • The type of the annotation. Makes down casting easier.

public void setPoints (List<PointF> points)

Sets polygon points in PDF coordinates.

Parameters
points List of points in polygon annotation.

Protected Methods

protected Pair<LineEndTypeLineEndType> getLineEnds ()

Returns current line ending styles for this line.

Returns
  • Pair of start and end line ending styles. If they're not set, returns NONE.