com.lowagie.text

Class Annotation

Implemented Interfaces:
Element, MarkupAttributes

public class Annotation
extends java.lang.Object
implements Element, MarkupAttributes

An Annotation is a little note that can be added to a page on a document.
See Also:
Element, Anchor

Field Summary

static String
APPLICATION
This is a possible attribute.
static String
CONTENT
This is a possible attribute.
static String
DEFAULTDIR
This is a possible attribute.
static String
DESTINATION
This is a possible attribute.
static String
FILE
This is a possible attribute.
static int
FILE_DEST
This is a possible annotation type.
static int
FILE_PAGE
This is a possible annotation type.
static int
LAUNCH
This is a possible annotation type.
static String
LLX
This is a possible attribute.
static String
LLY
This is a possible attribute.
static String
MIMETYPE
This is a possible attribute.
static String
NAMED
This is a possible attribute.
static int
NAMED_DEST
This is a possible annotation type.
static String
OPERATION
This is a possible attribute.
static String
PAGE
This is a possible attribute.
static String
PARAMETERS
This is a possible attribute.
static int
SCREEN
This is a possible annotation type.
static int
TEXT
This is a possible annotation type.
static String
TITLE
This is a possible attribute.
static String
URL
This is a possible attribute.
static int
URL_AS_STRING
This is a possible annotation type.
static int
URL_NET
This is a possible annotation type.
static String
URX
This is a possible attribute.
static String
URY
This is a possible attribute.
protected HashMap
annotationAttributes
This is the title of the Annotation.
protected int
annotationtype
This is the type of annotation.
protected float
llx
This is the lower left x-value
protected float
lly
This is the lower left y-value
protected Properties
markupAttributes
Contains extra markupAttributes
protected float
urx
This is the upper right x-value
protected float
ury
This is the upper right y-value

Fields inherited from interface com.lowagie.text.Element

ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITTG3_1D, CCITTG3_2D, CCITTG4, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE

Constructor Summary

Annotation(Properties attributes)
Returns an Annotation that has been constructed taking in account the value of some attributes .
Annotation(String title, String text)
Constructs an Annotation with a certain title and some text.
Annotation(String title, String text, float llx, float lly, float urx, float ury)
Constructs an Annotation with a certain title and some text.
Annotation(float llx, float lly, float urx, float ury)
Constructs an Annotation with a certain title and some text.
Annotation(float llx, float lly, float urx, float ury, String url)
Constructs an Annotation.
Annotation(float llx, float lly, float urx, float ury, String file, String dest)
Constructs an Annotation.
Annotation(float llx, float lly, float urx, float ury, String application, String parameters, String operation, String defaultdir)
Constructs an Annotation.
Annotation(float llx, float lly, float urx, float ury, String moviePath, String mimeType, boolean showOnDisplay)
Creates a Screen anotation to embed media clips
Annotation(float llx, float lly, float urx, float ury, String file, int page)
Constructs an Annotation.
Annotation(float llx, float lly, float urx, float ury, URL url)
Constructs an Annotation.
Annotation(float llx, float lly, float urx, float ury, int named)
Constructs an Annotation.

Method Summary

int
annotationType()
Returns the type of this Annotation.
HashMap
attributes()
Gets the content of this Annotation.
String
content()
Gets the content of this Annotation.
ArrayList
getChunks()
Gets all the chunks in this element.
String
getMarkupAttribute(String name)
Set
getMarkupAttributeNames()
Properties
getMarkupAttributes()
static boolean
isTag(String tag)
Checks if a given tag corresponds with this object.
float
llx()
Returns the lower left x-value.
float
llx(float def)
Returns the lower left x-value.
float
lly()
Returns the lower left y-value.
float
lly(float def)
Returns the lower left y-value.
boolean
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.
void
setDimensions(float llx, float lly, float urx, float ury)
Sets the dimensions of this annotation.
void
setMarkupAttribute(String name, String value)
void
setMarkupAttributes(Properties markupAttributes)
String
title()
Returns the title of this Annotation.
int
type()
Gets the type of the text element.
float
urx()
Returns the uppper right x-value.
float
urx(float def)
Returns the upper right x-value.
float
ury()
Returns the uppper right y-value.
float
ury(float def)
Returns the upper right y-value.

Field Details

APPLICATION

public static String APPLICATION
This is a possible attribute.

CONTENT

public static String CONTENT
This is a possible attribute.

DEFAULTDIR

public static String DEFAULTDIR
This is a possible attribute.

DESTINATION

public static String DESTINATION
This is a possible attribute.

FILE

public static String FILE
This is a possible attribute.

FILE_DEST

public static final int FILE_DEST
This is a possible annotation type.
Field Value:
3

FILE_PAGE

public static final int FILE_PAGE
This is a possible annotation type.
Field Value:
4

LAUNCH

public static final int LAUNCH
This is a possible annotation type.
Field Value:
6

LLX

public static String LLX
This is a possible attribute.

LLY

public static String LLY
This is a possible attribute.

MIMETYPE

public static String MIMETYPE
This is a possible attribute.

NAMED

public static String NAMED
This is a possible attribute.

NAMED_DEST

public static final int NAMED_DEST
This is a possible annotation type.
Field Value:
5

OPERATION

public static String OPERATION
This is a possible attribute.

PAGE

public static String PAGE
This is a possible attribute.

PARAMETERS

public static String PARAMETERS
This is a possible attribute.

SCREEN

public static final int SCREEN
This is a possible annotation type.
Field Value:
7

TEXT

public static final int TEXT
This is a possible annotation type.
Field Value:
0

TITLE

public static String TITLE
This is a possible attribute.

URL

public static String URL
This is a possible attribute.

URL_AS_STRING

public static final int URL_AS_STRING
This is a possible annotation type.
Field Value:
2

URL_NET

public static final int URL_NET
This is a possible annotation type.
Field Value:
1

URX

public static String URX
This is a possible attribute.

URY

public static String URY
This is a possible attribute.

annotationAttributes

protected HashMap annotationAttributes
This is the title of the Annotation.

annotationtype

protected int annotationtype
This is the type of annotation.

llx

protected float llx
This is the lower left x-value

lly

protected float lly
This is the lower left y-value

markupAttributes

protected Properties markupAttributes
Contains extra markupAttributes

urx

protected float urx
This is the upper right x-value

ury

protected float ury
This is the upper right y-value

Constructor Details

Annotation

public Annotation(Properties attributes)
Returns an Annotation that has been constructed taking in account the value of some attributes .
Parameters:
attributes - Some attributes

Annotation

public Annotation(String title,
                  String text)
Constructs an Annotation with a certain title and some text.
Parameters:
title - the title of the annotation
text - the content of the annotation

Annotation

public Annotation(String title,
                  String text,
                  float llx,
                  float lly,
                  float urx,
                  float ury)
Constructs an Annotation with a certain title and some text.
Parameters:
title - the title of the annotation
text - the content of the annotation
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value

Annotation

private Annotation(float llx,
                   float lly,
                   float urx,
                   float ury)
Constructs an Annotation with a certain title and some text.
Parameters:
llx - lower left x coordinate
lly - lower left y coordinate
urx - upper right x coordinate
ury - upper right y coordinate

Annotation

public Annotation(float llx,
                  float lly,
                  float urx,
                  float ury,
                  String url)
Constructs an Annotation.
Parameters:
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value
url - the external reference

Annotation

public Annotation(float llx,
                  float lly,
                  float urx,
                  float ury,
                  String file,
                  String dest)
Constructs an Annotation.
Parameters:
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value
file - an external PDF file
dest - the destination in this file

Annotation

public Annotation(float llx,
                  float lly,
                  float urx,
                  float ury,
                  String application,
                  String parameters,
                  String operation,
                  String defaultdir)
Constructs an Annotation.
Parameters:
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value
application - an external application
parameters - parameters to pass to this application
operation - the operation to pass to this application
defaultdir - the default directory to run this application in

Annotation

public Annotation(float llx,
                  float lly,
                  float urx,
                  float ury,
                  String moviePath,
                  String mimeType,
                  boolean showOnDisplay)
Creates a Screen anotation to embed media clips
Parameters:
llx -
lly -
urx -
ury -
moviePath - path to the media clip file
mimeType - mime type of the media
showOnDisplay - if true play on display of the page

Annotation

public Annotation(float llx,
                  float lly,
                  float urx,
                  float ury,
                  String file,
                  int page)
Constructs an Annotation.
Parameters:
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value
file - an external PDF file
page - a page number in this file

Annotation

public Annotation(float llx,
                  float lly,
                  float urx,
                  float ury,
                  URL url)
Constructs an Annotation.
Parameters:
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value
url - the external reference

Annotation

public Annotation(float llx,
                  float lly,
                  float urx,
                  float ury,
                  int named)
Constructs an Annotation.
Parameters:
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value
named - a named destination in this file

Method Details

annotationType

public int annotationType()
Returns the type of this Annotation.
Returns:
a type

attributes

public HashMap attributes()
Gets the content of this Annotation.
Returns:
a reference

content

public String content()
Gets the content of this Annotation.
Returns:
a reference

getChunks

public ArrayList getChunks()
Gets all the chunks in this element.
Specified by:
getChunks in interface Element
Returns:
an ArrayList

getMarkupAttribute

public String getMarkupAttribute(String name)
Specified by:
getMarkupAttribute in interface MarkupAttributes
See Also:
com.lowagie.text.MarkupAttributes.getMarkupAttribute(java.lang.String)

getMarkupAttributeNames

public Set getMarkupAttributeNames()
Specified by:
getMarkupAttributeNames in interface MarkupAttributes

getMarkupAttributes

public Properties getMarkupAttributes()
Specified by:
getMarkupAttributes in interface MarkupAttributes

isTag

public static boolean isTag(String tag)
Checks if a given tag corresponds with this object.
Parameters:
tag - the given tag
Returns:
true if the tag corresponds

llx

public float llx()
Returns the lower left x-value.
Returns:
a value

llx

public float llx(float def)
Returns the lower left x-value.
Parameters:
def - the default value
Returns:
a value

lly

public float lly()
Returns the lower left y-value.
Returns:
a value

lly

public float lly(float def)
Returns the lower left y-value.
Parameters:
def - the default value
Returns:
a value

process

public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.
Specified by:
process in interface Element
Parameters:
listener - an ElementListener
Returns:
true if the element was processed successfully

setDimensions

public void setDimensions(float llx,
                          float lly,
                          float urx,
                          float ury)
Sets the dimensions of this annotation.
Parameters:
llx - the lower left x-value
lly - the lower left y-value
urx - the upper right x-value
ury - the upper right y-value

setMarkupAttribute

public void setMarkupAttribute(String name,
                               String value)
Specified by:
setMarkupAttribute in interface MarkupAttributes
See Also:
com.lowagie.text.MarkupAttributes.setMarkupAttribute(java.lang.String, java.lang.String)

setMarkupAttributes

public void setMarkupAttributes(Properties markupAttributes)
Specified by:
setMarkupAttributes in interface MarkupAttributes
See Also:
com.lowagie.text.MarkupAttributes.setMarkupAttributes(java.util.Properties)

title

public String title()
Returns the title of this Annotation.
Returns:
a name

type

public int type()
Gets the type of the text element.
Specified by:
type in interface Element
Returns:
a type

urx

public float urx()
Returns the uppper right x-value.
Returns:
a value

urx

public float urx(float def)
Returns the upper right x-value.
Parameters:
def - the default value
Returns:
a value

ury

public float ury()
Returns the uppper right y-value.
Returns:
a value

ury

public float ury(float def)
Returns the upper right y-value.
Parameters:
def - the default value
Returns:
a value