Class ShapeAnnotation
-
- All Implemented Interfaces:
public abstract class ShapeAnnotation extends Annotation
Abstract base-class of all shape annotations: LineAnnotation, SquareAnnotation, CircleAnnotation, PolygonAnnotation, PolylineAnnotation. Shape annotations can also be measurement annotations if created using the measurement tools included with the Measurement Tools license component.
-
-
Method Summary
Modifier and Type Method Description Size
getMinimumSize()
Returns the minimum size of the annotation. void
updateTransformationProperties(@NonNull() RectF newBoundingBox, @NonNull() RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e. boolean
isMeasurement()
Returns true
when the annotation is a measurement annotation.Scale
getMeasurementScale()
Returns the Scale of this shape annotation if this is a measurement, null
if not.void
setMeasurementScale(@NonNull() Scale scale)
Sets the Scale of this shape annotation. MeasurementPrecision
getMeasurementPrecision()
Returns the MeasurementPrecision of this shape annotation if this is a measurement, null
if not.void
setMeasurementPrecision(@NonNull() MeasurementPrecision precision)
Sets the MeasurementPrecision of this shape annotation. -
-
Method Detail
-
getMinimumSize
@NonNull() Size getMinimumSize()
Returns the minimum size of the annotation.
- Returns:
The minimum annotation size in PDF points.
-
updateTransformationProperties
void updateTransformationProperties(@NonNull() RectF newBoundingBox, @NonNull() 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).
-
isMeasurement
boolean isMeasurement()
Returns
true
when the annotation is a measurement annotation. Measurement annotations can be: - LineAnnotation: Distance measurement - PolylineAnnotation: Perimeter measurement - PolygonAnnotation: Polygonal area measurement - CircleAnnotation: Elliptical area measurement - SquareAnnotation: Rectangular area measurement- Returns:
true
when the annotation is a measurement annotation.
-
getMeasurementScale
@Nullable() Scale getMeasurementScale()
Returns the Scale of this shape annotation if this is a measurement,
null
if not. This information can also be taken from getMeasurementInfo.- Returns:
If this is a measurement, returns Scale for this annotation. If not a measurement, returns
null
.
-
setMeasurementScale
void setMeasurementScale(@NonNull() Scale scale)
Sets the Scale of this shape annotation. Throws an InvalidPSPDFKitLicenseException if measurement tools are not licensed.
- Parameters:
scale
- Scale for this measurement annotation.
-
getMeasurementPrecision
@Nullable() MeasurementPrecision getMeasurementPrecision()
Returns the MeasurementPrecision of this shape annotation if this is a measurement,
null
if not. This information can also be taken from getMeasurementInfo.- Returns:
If this is a measurement, returns MeasurementPrecision for this annotation. If not a measurement, returns
null
.
-
setMeasurementPrecision
void setMeasurementPrecision(@NonNull() MeasurementPrecision precision)
Sets the MeasurementPrecision of this shape annotation. Throws an InvalidPSPDFKitLicenseException if measurement tools are not licensed.
- Parameters:
precision
- MeasurementPrecision for this measurement annotation.
-
-
-
-