Package com.pspdfkit.annotations
Class PolygonAnnotation
-
- All Implemented Interfaces:
public class PolygonAnnotation extends BaseLineAnnotation
Represents a closed polygon on a page.
-
-
Constructor Summary
Constructors Constructor Description PolygonAnnotation(int pageIndex, List<PointF> points)
Creates a new polygon annotation. PolygonAnnotation(int pageIndex, List<PointF> points, Scale scale, MeasurementPrecision precision)
Creates a measurement rectangular area annotation. PolygonAnnotation(AnnotationPropertyManager properties, boolean markDirty)
Intended for internal usage only.
-
Method Summary
Modifier and Type Method Description AnnotationType
getType()
Gets the annotation type of the annotation. List<PointF>
getPoints()
Returns polygon points in PDF coordinates. void
setPoints(@NonNull() List<PointF> points)
Sets polygon points in PDF coordinates. void
setBorderStyle(@NonNull() BorderStyle borderStyle)
Sets a border style for current annotation. BorderStyle
getBorderStyle()
Returns the current border style on the annotation or NONE if none is set. -
-
Constructor Detail
-
PolygonAnnotation
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.
-
PolygonAnnotation
PolygonAnnotation(int pageIndex, List<PointF> points, Scale scale, MeasurementPrecision precision)
Creates a measurement rectangular area annotation.- Parameters:
pageIndex
- Page to which this annotation will be attached to.points
- List of points in polygon annotation.scale
- Measurement com.pspdfkit.annotations.measurements.Scale for the annotation.precision
- Measurement MeasurementPrecision for the annotation.
-
PolygonAnnotation
PolygonAnnotation(AnnotationPropertyManager properties, boolean markDirty)
Intended for internal usage only.
-
-
Method Detail
-
getType
@NonNull() AnnotationType getType()
Gets the annotation type of the annotation.
- Returns:
The type of the annotation. Makes down casting easier.
-
getPoints
@NonNull() 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.
-
setPoints
void setPoints(@NonNull() List<PointF> points)
Sets polygon points in PDF coordinates.
- Parameters:
points
- List of points in polygon annotation.
-
setBorderStyle
void setBorderStyle(@NonNull() BorderStyle borderStyle)
Sets a border style for current annotation. It should be accompanied with setBorderColor call to set the border color as well.
- Parameters:
borderStyle
- BorderStyle to be set.
-
getBorderStyle
@NonNull() BorderStyle getBorderStyle()
Returns the current border style on the annotation or NONE if none is set.
- Returns:
Border style or NONE if none is set.
-
-
-
-