Class NoteAnnotation
-
- All Implemented Interfaces:
public class NoteAnnotation extends Annotation
Represents a note (shown as an icon) on the page.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public @interface
NoteAnnotation.IconName
Denotes that a parameter must belong to on of these strings defined in : COMMENT, RIGHT_POINTER, RIGHT_ARROW, CHECK, CIRCLE, CROSS, INSERT, NEW_PARAGRAPH, NOTE, PARAGRAPH, HELP, STAR, KEY.
-
Field Summary
Fields Modifier and Type Field Description public final static String
COMMENT
public final static String
RIGHT_POINTER
public final static String
RIGHT_ARROW
public final static String
CHECK
public final static String
CIRCLE
public final static String
CROSS
public final static String
INSERT
public final static String
NEW_PARAGRAPH
public final static String
NOTE
public final static String
PARAGRAPH
public final static String
HELP
public final static String
STAR
public final static String
KEY
-
Constructor Summary
Constructors Constructor Description NoteAnnotation(int pageIndex, RectF annotationRect, String contents, String iconName)
Creates a new note annotation NoteAnnotation(AnnotationPropertyManager properties, boolean markDirty)
Intended for internal usage only.
-
Method Summary
Modifier and Type Method Description AnnotationType
getType()
Gets the annotation type of the annotation. boolean
isResizable()
Always returns false
, since note annotations are not resizable.void
updateTransformationProperties(@NonNull() RectF newBoundingBox, @NonNull() RectF oldBoundingBox)
Annotations may override this method to transform their properties (i.e. String
getIconName()
Returns the name of the icon that should be displayed for this annotation. void
setIconName(@NoteAnnotation.IconName() String iconName)
Sets the name of the icon that should be displayed for this annotation. boolean
isOpen()
Checks if the popup of this annotation is opened. -
-
Constructor Detail
-
NoteAnnotation
NoteAnnotation(int pageIndex, RectF annotationRect, String contents, String iconName)
Creates a new note annotation- Parameters:
pageIndex
- Page to which this annotation will be attached to.annotationRect
- Rectangle in page coordinates of the note position on the page.contents
- Text contents of the note.iconName
- Icon name of the note, may benull
.
-
NoteAnnotation
NoteAnnotation(AnnotationPropertyManager properties, boolean markDirty)
Intended for internal usage only.
-
-
Method Detail
-
getType
@NonNull() AnnotationType getType()
Gets the annotation type of the annotation.
- Returns:
The type of the annotation. Makes down casting easier.
-
isResizable
boolean isResizable()
Always returns
false
, since note annotations are not resizable.- Returns:
false
-
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).
-
getIconName
@NonNull() String getIconName()
Returns the name of the icon that should be displayed for this annotation.
- Returns:
Icon name, NOTE by default.
-
setIconName
void setIconName(@NoteAnnotation.IconName() String iconName)
Sets the name of the icon that should be displayed for this annotation.
- Parameters:
iconName
- Icon name to be set.
-
isOpen
boolean isOpen()
Checks if the popup of this annotation is opened.
- Returns:
true
if annotation popup is displayed,false
otherwise.
-
-
-
-