Package com.pspdfkit.annotations
Class PolylineAnnotation
-
- All Implemented Interfaces:
public class PolylineAnnotation extends BaseLineAnnotation
Represents a polyline on the page. Polyline is similar to PolygonAnnotation but is not closed and supports LineEndTypes.
-
-
Constructor Summary
Constructors Constructor Description PolylineAnnotation(int pageIndex, List<PointF> points)
Creates a new polyline annotation. PolylineAnnotation(int pageIndex, List<PointF> points, Scale scale, MeasurementPrecision precision)
Creates a measurement perimeter annotation. PolylineAnnotation(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 polyline points in PDF coordinates. void
setPoints(@NonNull() List<PointF> points)
Sets polyline points in PDF coordinates. void
setLineEnds(@NonNull() LineEndType lineEnd1, @NonNull() LineEndType lineEnd2)
Sets line ending style for this polyline. Pair<LineEndType, LineEndType>
getLineEnds()
Returns current line ending styles for this polyline. -
-
Constructor Detail
-
PolylineAnnotation
PolylineAnnotation(int pageIndex, List<PointF> points)
Creates a new polyline annotation.- Parameters:
pageIndex
- Page to which this annotation will be attached to.points
- List of points in polyline annotation.
-
PolylineAnnotation
PolylineAnnotation(int pageIndex, List<PointF> points, Scale scale, MeasurementPrecision precision)
Creates a measurement perimeter annotation.- Parameters:
pageIndex
- Page to which this annotation will be attached to.points
- List of points in polyline annotation.scale
- Measurement com.pspdfkit.annotations.measurements.Scale for the annotation.precision
- Measurement MeasurementPrecision for the annotation.
-
PolylineAnnotation
PolylineAnnotation(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 polyline points in PDF coordinates.
- Returns:
List of polyline points. If for any reason valid coordinates aren't set, returns (0, 0) points.
-
setPoints
void setPoints(@NonNull() List<PointF> points)
Sets polyline points in PDF coordinates.
- Parameters:
points
- List of points in polyline annotation.
-
setLineEnds
void setLineEnds(@NonNull() LineEndType lineEnd1, @NonNull() LineEndType lineEnd2)
Sets line ending style for this polyline.
- Parameters:
lineEnd1
- LineEndType for start of this polyline.lineEnd2
- LineEndType for end of this polyline.
-
getLineEnds
@NonNull() Pair<LineEndType, LineEndType> getLineEnds()
Returns current line ending styles for this polyline.
- Returns:
Pair of start and end polyline ending styles. If they're not set, returns NONE.
-
-
-
-