Class FileAnnotation
-
- All Implemented Interfaces:
public class FileAnnotation extends Annotation
Represents an annotation associated with EmbeddedFile.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interface
FileAnnotation.IconName
Denotes that a parameter must belong to on of these strings defined in : PUSH_PIN, PAPERCLIP, GRAPH, TAG.
-
Constructor Summary
Constructors Constructor Description FileAnnotation(int pageIndex, RectF boundingBox, EmbeddedFileSource embeddedFileSource)
Creates a new file annotation. FileAnnotation(AnnotationPropertyManager properties, boolean markDirty, String resourceId)
Intended for internal usage only.
-
Method Summary
Modifier and Type Method Description String
getIconName()
Returns the name of the icon that should be displayed for this annotation. void
setIconName(@FileAnnotation.IconName() String iconName)
Sets the name of the icon that should be displayed for this annotation. EmbeddedFile
getFile()
Returns a file set for this annotation. void
setFileSource(@NonNull() EmbeddedFileSource fileSource)
Replaces an embedded file associated with this annotation. AnnotationType
getType()
Gets the annotation type of the annotation. void
updateTransformationProperties(@NonNull() RectF newBoundingBox, @NonNull() RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e. boolean
isResizable()
Check if the annotation is resizable, or if this is a non-resizable annotation. boolean
isLocked()
Check if the annotation is locked - i.e. -
-
Constructor Detail
-
FileAnnotation
FileAnnotation(int pageIndex, RectF boundingBox, EmbeddedFileSource embeddedFileSource)
Creates a new file annotation.- Parameters:
pageIndex
- Page to which this annotation will be attached to.boundingBox
- Annotation's bounding box on the page in PDF coordinates.embeddedFileSource
- Source of the file data that should be attached to the annotation.
-
FileAnnotation
FileAnnotation(AnnotationPropertyManager properties, boolean markDirty, String resourceId)
Intended for internal usage only.
-
-
Method Detail
-
getIconName
@NonNull() String getIconName()
Returns the name of the icon that should be displayed for this annotation.
- Returns:
Icon name, {@value PUSH_PIN} by default.
-
setIconName
void setIconName(@FileAnnotation.IconName() String iconName)
Sets the name of the icon that should be displayed for this annotation.
- Parameters:
iconName
- Icon name to be set.
-
getFile
@Nullable() EmbeddedFile getFile()
Returns a file set for this annotation.
- Returns:
Embedded file associated with this annotation or
null
if no embedded file is currently set.
-
setFileSource
void setFileSource(@NonNull() EmbeddedFileSource fileSource)
Replaces an embedded file associated with this annotation.
- Parameters:
fileSource
- Source for the embedded file data.
-
getType
@NonNull() AnnotationType getType()
Gets the annotation type of the annotation.
- Returns:
The type of the annotation. Makes down casting easier.
-
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).
-
isResizable
boolean isResizable()
Check if the annotation is resizable, or if this is a non-resizable annotation.
- Returns:
true
if the annotation can be resized (e.g. ink annotation) orfalse
if it is a non-resizable one (e.g. note annotation).
-
isLocked
boolean isLocked()
Check if the annotation is locked - i.e. annotation can't be deleted or modified (except contents).
- Returns:
true
if the annotation is locked orfalse
if it can be freely modified.
-
-
-
-