com.lowagie.text

Interface Element

Known Subinterfaces:
TextElementArray
Known Implementing Classes:
AbstractRtfField, Anchor, Annotation, Cell, Chapter, ChapterAutoNumber, Chunk, GenericRtfField, GreekList, Header, HeaderFooter, Image, ImgCCITT, ImgPostscript, ImgRaw, ImgTemplate, ImgWMF, IncCell, Jpeg, List, ListItem, MarkedObject, MarkedSection, Meta, MultiColumnText, Paragraph, PdfCell, PdfPCell, PdfPTable, PdfTable, Phrase, Rectangle, RomanList, Row, RtfAddableElement, RtfAnchor, RtfCell, RtfDirectContent, RtfField, RtfHeaderFooter, RtfHeaderFooter, RtfHeaderFooterGroup, RtfHeaderFooters, RtfPageNumber, RtfPageNumber, RtfShape, RtfShapePosition, RtfShapeProperty, RtfTab, RtfTabGroup, RtfTableCell, RtfTableOfContents, RtfTotalPageNumber, RtfTOC, RtfTOCEntry, RtfTOCEntry, Section, SimpleCell, SimpleTable, Table, ZapfDingbatsList, ZapfDingbatsNumberList

public interface Element

Interface for a text element.

Remark: I looked at the interface javax.swing.text.Element, but I decided to write my own text-classes for two reasons:

  1. The javax.swing.text-classes may be very generic, I think they are overkill: they are to heavy for what they have to do.
  2. A lot of people using iText (formerly known as rugPdf), still use JDK1.1.x. I try to keep the Java2 requirements limited to the Collection classes (I think they're really great). However, if I use the javax.swing.text classes, it will become very difficult to downgrade rugPdf.
See Also:
Anchor, Cell, Chapter, Chunk, Header, Image, Jpeg, List, ListItem, Meta, Paragraph, Phrase, Rectangle, Row, Section, Table

Field Summary

static int
ALIGN_BASELINE
A possible value for vertical alignment.
static int
ALIGN_BOTTOM
A possible value for vertical alignment.
static int
ALIGN_CENTER
A possible value for paragraph alignment.
static int
ALIGN_JUSTIFIED
A possible value for paragraph alignment.
static int
ALIGN_JUSTIFIED_ALL
Does the same as ALIGN_JUSTIFIED but the last line is also spread out.
static int
ALIGN_LEFT
A possible value for paragraph alignment.
static int
ALIGN_MIDDLE
A possible value for vertical alignment.
static int
ALIGN_RIGHT
A possible value for paragraph alignment.
static int
ALIGN_TOP
A possible value for vertical alignment.
static int
ALIGN_UNDEFINED
A possible value for paragraph alignment.
static int
ANCHOR
This is a possible type of Element
static int
ANNOTATION
This is a possible type of Element.
static int
AUTHOR
This is a possible type of Element .
static int
CCITTG3_1D
Pure one-dimensional encoding (Group 3, 1-D)
static int
CCITTG3_2D
Mixed one- and two-dimensional encoding (Group 3, 2-D)
static int
CCITTG4
Pure two-dimensional encoding (Group 4)
static int
CCITT_BLACKIS1
A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels,
static int
CCITT_ENCODEDBYTEALIGN
A flag indicating whether the filter expects extra 0-bits before each encoded line so that the line begins on a byte boundary.
static int
CCITT_ENDOFBLOCK
A flag indicating whether the filter expects the encoded data to be terminated by an end-of-block pattern, overriding the Rows parameter.
static int
CCITT_ENDOFLINE
A flag indicating whether end-of-line bit patterns are required to be present in the encoding.
static int
CELL
This is a possible type of Element.
static int
CHAPTER
This is a possible type of Element
static int
CHUNK
This is a possible type of Element.
static int
CREATIONDATE
This is a possible type of Element .
static int
CREATOR
This is a possible type of Element .
static int
HEADER
This is a possible type of Element.
static int
IMGRAW
This is a possible type of Element.
static int
IMGTEMPLATE
This is a possible type of Element.
static int
JPEG
This is a possible type of Element.
static int
KEYWORDS
This is a possible type of Element.
static int
LIST
This is a possible type of Element
static int
LISTITEM
This is a possible type of Element
static int
MARKED
This is a possible type of Element.
static int
MULTI_COLUMN_TEXT
This is a possible type of Element.
static int
PARAGRAPH
This is a possible type of Element.
static int
PHRASE
This is a possible type of Element.
static int
PRODUCER
This is a possible type of Element .
static int
PTABLE
This is a possible type of Element.
static int
RECTANGLE
This is a possible type of Element.
static int
ROW
This is a possible type of Element.
static int
SECTION
This is a possible type of Element
static int
SUBJECT
This is a possible type of Element.
static int
TABLE
This is a possible type of Element.
static int
TITLE
This is a possible type of Element.

Method Summary

ArrayList
getChunks()
Gets all the chunks in this element.
boolean
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.
String
toString()
Gets the content of the text element.
int
type()
Gets the type of the text element.

Field Details

ALIGN_BASELINE

public static final int ALIGN_BASELINE
A possible value for vertical alignment.
Field Value:
7

ALIGN_BOTTOM

public static final int ALIGN_BOTTOM
A possible value for vertical alignment.
Field Value:
6

ALIGN_CENTER

public static final int ALIGN_CENTER
A possible value for paragraph alignment. This specifies that the text is aligned to the center and extra whitespace should be placed equally on the left and right.
Field Value:
1

ALIGN_JUSTIFIED

public static final int ALIGN_JUSTIFIED
A possible value for paragraph alignment. This specifies that extra whitespace should be spread out through the rows of the paragraph with the text lined up with the left and right indent except on the last line which should be aligned to the left.
Field Value:
3

ALIGN_JUSTIFIED_ALL

public static final int ALIGN_JUSTIFIED_ALL
Does the same as ALIGN_JUSTIFIED but the last line is also spread out.
Field Value:
8

ALIGN_LEFT

public static final int ALIGN_LEFT
A possible value for paragraph alignment. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right.
Field Value:
0

ALIGN_MIDDLE

public static final int ALIGN_MIDDLE
A possible value for vertical alignment.
Field Value:
5

ALIGN_RIGHT

public static final int ALIGN_RIGHT
A possible value for paragraph alignment. This specifies that the text is aligned to the right indent and extra whitespace should be placed on the left.
Field Value:
2

ALIGN_TOP

public static final int ALIGN_TOP
A possible value for vertical alignment.
Field Value:
4

ALIGN_UNDEFINED

public static final int ALIGN_UNDEFINED
A possible value for paragraph alignment. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right.
Field Value:
-1

ANCHOR

public static final int ANCHOR
This is a possible type of Element
Field Value:
17

ANNOTATION

public static final int ANNOTATION
This is a possible type of Element.
Field Value:
29

AUTHOR

public static final int AUTHOR
This is a possible type of Element .
Field Value:
4

CCITTG3_1D

public static final int CCITTG3_1D
Pure one-dimensional encoding (Group 3, 1-D)
Field Value:
257

CCITTG3_2D

public static final int CCITTG3_2D
Mixed one- and two-dimensional encoding (Group 3, 2-D)
Field Value:
258

CCITTG4

public static final int CCITTG4
Pure two-dimensional encoding (Group 4)
Field Value:
256

CCITT_BLACKIS1

public static final int CCITT_BLACKIS1
A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels,
Field Value:
1

CCITT_ENCODEDBYTEALIGN

public static final int CCITT_ENCODEDBYTEALIGN
A flag indicating whether the filter expects extra 0-bits before each encoded line so that the line begins on a byte boundary.
Field Value:
2

CCITT_ENDOFBLOCK

public static final int CCITT_ENDOFBLOCK
A flag indicating whether the filter expects the encoded data to be terminated by an end-of-block pattern, overriding the Rows parameter. The use of this flag will set the key /EndOfBlock to false.
Field Value:
8

CCITT_ENDOFLINE

public static final int CCITT_ENDOFLINE
A flag indicating whether end-of-line bit patterns are required to be present in the encoding.
Field Value:
4

CELL

public static final int CELL
This is a possible type of Element.
Field Value:
20

CHAPTER

public static final int CHAPTER
This is a possible type of Element
Field Value:
16

CHUNK

public static final int CHUNK
This is a possible type of Element.
Field Value:
10

CREATIONDATE

public static final int CREATIONDATE
This is a possible type of Element .
Field Value:
6

CREATOR

public static final int CREATOR
This is a possible type of Element .
Field Value:
7

HEADER

public static final int HEADER
This is a possible type of Element.
Field Value:
0

IMGRAW

public static final int IMGRAW
This is a possible type of Element.
Field Value:
34

IMGTEMPLATE

public static final int IMGTEMPLATE
This is a possible type of Element.
Field Value:
35

JPEG

public static final int JPEG
This is a possible type of Element.
Field Value:
32

KEYWORDS

public static final int KEYWORDS
This is a possible type of Element.
Field Value:
3

LIST

public static final int LIST
This is a possible type of Element
Field Value:
14

LISTITEM

public static final int LISTITEM
This is a possible type of Element
Field Value:
15

MARKED

public static final int MARKED
This is a possible type of Element.
Field Value:
50

MULTI_COLUMN_TEXT

public static final int MULTI_COLUMN_TEXT
This is a possible type of Element.
Field Value:
40

PARAGRAPH

public static final int PARAGRAPH
This is a possible type of Element.
Field Value:
12

PHRASE

public static final int PHRASE
This is a possible type of Element.
Field Value:
11

PRODUCER

public static final int PRODUCER
This is a possible type of Element .
Field Value:
5

PTABLE

public static final int PTABLE
This is a possible type of Element.
Field Value:
23

RECTANGLE

public static final int RECTANGLE
This is a possible type of Element.
Field Value:
30

ROW

public static final int ROW
This is a possible type of Element.
Field Value:
21

SECTION

public static final int SECTION
This is a possible type of Element
Field Value:
13

SUBJECT

public static final int SUBJECT
This is a possible type of Element.
Field Value:
2

TABLE

public static final int TABLE
This is a possible type of Element.
Field Value:
22

TITLE

public static final int TITLE
This is a possible type of Element.
Field Value:
1

Method Details

getChunks

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

process

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

toString

public String toString()
Gets the content of the text element.
Returns:
a type

type

public int type()
Gets the type of the text element.
Returns:
a type