public abstract class

BaseLineAnnotation

extends ShapeAnnotation
java.lang.Object
   ↳ com.pspdfkit.annotations.Annotation
     ↳ com.pspdfkit.annotations.ShapeAnnotation
       ↳ com.pspdfkit.annotations.BaseLineAnnotation
Known Direct Subclasses

Class Overview

Abstract base class for PolygonAnnotation and PolylineAnnotation.

Summary

[Expand]
Inherited Constants
From class com.pspdfkit.annotations.Annotation
[Expand]
Inherited Fields
From class com.pspdfkit.annotations.Annotation
Public Methods
List<Integer> getDashArray()
Returns currently set dash array or null if no pattern is set.
BorderStyle getLineStyle()
Returns currently set line drawing style.
float getLineWidth()
Gets line width/thickness.
Size getMinimumSize()
Returns the minimum size of the annotation.
void setDashArray(List<Integer> dashes)
Sets a dash style for the line.
void setLineStyle(BorderStyle style)
Sets current drawing style of the line.
void setLineWidth(float lineWidth)
Sets line width/thickness.
void updateTransformationProperties(RectF newBoundingBox, RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e.
Protected Methods
Pair<LineEndTypeLineEndType> getLineEnds()
Returns current line ending styles for this line.
MeasurementLabelValue getMeasurementLabelValue(MeasurementProperties measurementProperties)
Return the measurement label and value for this annotation if it is a measurement.
void setLineEnds(LineEndType lineEnd1, LineEndType lineEnd2)
Sets line ending style for this line.
[Expand]
Inherited Methods
From class com.pspdfkit.annotations.ShapeAnnotation
From class com.pspdfkit.annotations.Annotation
From class java.lang.Object

Public Methods

public List<Integer> getDashArray ()

Returns currently set dash array or null if no pattern is set.

Returns
  • Currently set dash array

public BorderStyle getLineStyle ()

Returns currently set line drawing style.

Returns
  • currently set line style or NONE if none is set.

public float getLineWidth ()

Gets line width/thickness.

Returns
  • Line width in PDF points.

public Size getMinimumSize ()

Returns the minimum size of the annotation.

Returns
  • The minimum annotation size in PDF points.

public void setDashArray (List<Integer> dashes)

Sets a dash style for the line. It's in form of an array where the numbers mean full_length, empty length, full_length... etc.. The pattern is repeated.

To get a dashed line, setLineStyle(BorderStyle) should be set to DASHED and color of the line should be set with setColor(int).

Parameters
dashes List of integer numbers representing lengths of a pattern. E.g. { 2, 3 } will generate a dash pattern with lines of length 2 and empty spaces of length 3.

public void setLineStyle (BorderStyle style)

Sets current drawing style of the line.

Parameters
style Line style, one of BorderStyle constants.

public void setLineWidth (float lineWidth)

Sets line width/thickness.

Parameters
lineWidth Line width in PDF points.

public void updateTransformationProperties (RectF newBoundingBox, RectF oldBoundingBox)

Annotations may override this method to transform their properties (i.e. points, rects, sizes) whenever the bounding box of the annotation changed.

Parameters
newBoundingBox New bounding box of the annotation (in PDF points).
oldBoundingBox Old bounding box of the annotation (in PDF points).

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.

protected MeasurementLabelValue getMeasurementLabelValue (MeasurementProperties measurementProperties)

Return the measurement label and value for this annotation if it is a measurement. Returns null if it's not a measurement. Overridden in child shape annotations who can be measurements. Calculates the measurement value based on the passed `measurementProperties` and shape size.

Parameters
measurementProperties the properties for this measurement. Including Scale and FloatPrecision.
Returns
  • The calculated measurement value and label, or null if it's not a measurement.

protected void setLineEnds (LineEndType lineEnd1, LineEndType lineEnd2)

Sets line ending style for this line.

Parameters
lineEnd1 LineEndType for start of this line.
lineEnd2 LineEndType for end of this line.