java.lang.Object | ||
↳ | com.pspdfkit.annotations.Annotation | |
↳ | com.pspdfkit.annotations.ShapeAnnotation |
![]() |
![]() |
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.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
FloatPrecision |
getMeasurementPrecision()
Returns the
FloatPrecision of this shape annotation if this is a measurement, null if not. | ||||||||||
Scale |
getMeasurementScale()
Returns the
Scale of this shape annotation if this is a measurement, null if not. | ||||||||||
Size |
getMinimumSize()
Returns the minimum size of the annotation.
| ||||||||||
boolean |
isMeasurement()
Returns
true when the annotation is a measurement annotation. | ||||||||||
void |
setMeasurementPrecision(FloatPrecision precision)
Sets the
FloatPrecision of this shape annotation. | ||||||||||
void |
setMeasurementScale(Scale scale)
Sets the
Scale of this shape annotation. | ||||||||||
void |
updateTransformationProperties(RectF newBoundingBox, RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
setMeasurementProperties(Scale scale, FloatPrecision precision)
Once these are set, the shape becomes a measurement annotation.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Returns the FloatPrecision
of this shape annotation if this is a measurement, null
if not.
This information can also be taken from getMeasurementInfo()
.
FloatPrecision
for this annotation.
If not a measurement, returns null
.
Returns the Scale
of this shape annotation if this is a measurement, null
if not.
This information can also be taken from getMeasurementInfo()
.
Scale
for this annotation.
If not a measurement, returns null
.
Returns the minimum size of the annotation.
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
true
when the annotation is a measurement annotation.
Sets the FloatPrecision
of this shape annotation.
Throws an InvalidPSPDFKitLicenseException
if measurement tools are not licensed.
precision | FloatPrecision for this measurement annotation.
|
---|
Sets the Scale
of this shape annotation. Throws an InvalidPSPDFKitLicenseException
if measurement tools are not
licensed.
scale | Scale for this measurement annotation.
|
---|
Annotations may override this method to transform their properties (i.e. points, rects, sizes) whenever the bounding box of the annotation changed.
newBoundingBox | New bounding box of the annotation (in PDF points). |
---|---|
oldBoundingBox | Old bounding box of the annotation (in PDF points). |
Once these are set, the shape becomes a measurement annotation. Throws if measurements are not licensed.