Package eu.europa.esig.dss.pdf
Class AnnotationBox
java.lang.Object
eu.europa.esig.dss.pdf.AnnotationBox
This class defines a PDF annotation dimension and position (note, shape, signature field, etc.)
-
Constructor Summary
ConstructorDescriptionAnnotationBox
(float minX, float minY, float maxX, float maxY) Default constructor (normalizes the provided properties)AnnotationBox
(SignatureFieldParameters fieldParameters) The constructor to instantiateAnnotationBox
fromSignatureFieldParameters
-
Method Summary
Modifier and TypeMethodDescriptionboolean
float
Returns a height of the boxfloat
getMaxX()
Returns an upper right X coordinatefloat
getMaxY()
Returns an upper right Y coordinatefloat
getMinX()
Returns a lower left X coordinatefloat
getMinY()
Returns a lower left Y coordinatefloat
getWidth()
Returns a width of the boxint
hashCode()
boolean
isOverlap
(AnnotationBox box) Checks if the currentAnnotationBox
overlaps with the givenbox
boolean
isOverlap
(PdfAnnotation pdfAnnotation) Checks if the currentAnnotationBox
overlaps with the givenpdfAnnotation
toPdfPageCoordinates
(float pageHeight) Creates a newAnnotationBox
mirrored vertically relatively to the givenpageHeight
The basis for the method: in used pdf implementations the Y origin is bottom based, while in DSS parameters is top-basedtoString()
-
Constructor Details
-
AnnotationBox
public AnnotationBox(float minX, float minY, float maxX, float maxY) Default constructor (normalizes the provided properties)- Parameters:
minX
- the lower left X coordinateminY
- the lower left Y coordinatemaxX
- the upper right X coordinatemaxY
- the upper right Y coordinate
-
AnnotationBox
The constructor to instantiateAnnotationBox
fromSignatureFieldParameters
- Parameters:
fieldParameters
-SignatureFieldParameters
-
-
Method Details
-
getMinX
public float getMinX()Returns a lower left X coordinate- Returns:
- lower left X
-
getMinY
public float getMinY()Returns a lower left Y coordinate- Returns:
- lower left Y
-
getMaxX
public float getMaxX()Returns an upper right X coordinate- Returns:
- upper right X
-
getMaxY
public float getMaxY()Returns an upper right Y coordinate- Returns:
- upper right Y
-
getWidth
public float getWidth()Returns a width of the box- Returns:
- width
-
getHeight
public float getHeight()Returns a height of the box- Returns:
- height
-
toPdfPageCoordinates
Creates a newAnnotationBox
mirrored vertically relatively to the givenpageHeight
The basis for the method: in used pdf implementations the Y origin is bottom based, while in DSS parameters is top-based- Parameters:
pageHeight
- the height of a page the annotation box will be created on- Returns:
AnnotationBox
-
isOverlap
Checks if the currentAnnotationBox
overlaps with the givenpdfAnnotation
- Parameters:
pdfAnnotation
-PdfAnnotation
to check against- Returns:
- TRUE when the current objects overlaps the annotation, FALSE otherwise
-
isOverlap
Checks if the currentAnnotationBox
overlaps with the givenbox
- Parameters:
box
-AnnotationBox
to check against- Returns:
- TRUE when the current objects overlaps
box
, FALSE otherwise
-
hashCode
public int hashCode() -
equals
-
toString
-