-
- All Known Subinterfaces:
LargeElement,TextElementArray
- All Known Implementing Classes:
Anchor,Annotation,Cell,Chapter,ChapterAutoNumber,Chunk,DottedLineSeparator,GreekList,Header,HeaderFooter,Image,ImgCCITT,ImgJBIG2,ImgRaw,ImgTemplate,ImgWMF,IncCell,Jpeg,Jpeg2000,LineSeparator,List,ListItem,MarkedObject,MarkedSection,Meta,MultiColumnText,Paragraph,PdfCell,PdfPCell,PdfPTable,PdfTable,Phrase,Rectangle,RectangleReadOnly,RomanList,Row,Section,SimpleCell,SimpleTable,Table,VerticalPositionMark,ZapfDingbatsList,ZapfDingbatsNumberList
public interface ElementInterface 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:
- The javax.swing.text-classes may be very generic, I think they are overkill: they are to heavy for what they have to do.
- 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.
-
-
Field Summary
Fields Modifier and Type Field Description static intALIGN_BASELINEA possible value for vertical alignment.static intALIGN_BOTTOMA possible value for vertical alignment.static intALIGN_CENTERA possible value for paragraph alignment.static intALIGN_JUSTIFIEDA possible value for paragraph alignment.static intALIGN_JUSTIFIED_ALLDoes the same as ALIGN_JUSTIFIED but the last line is also spread out.static intALIGN_LEFTA possible value for paragraph alignment.static intALIGN_MIDDLEA possible value for vertical alignment.static intALIGN_RIGHTA possible value for paragraph alignment.static intALIGN_TOPA possible value for vertical alignment.static intALIGN_UNDEFINEDA possible value for paragraph alignment.static intANCHORThis is a possible type ofElementstatic intANNOTATIONThis is a possible type ofElement.static intAUTHORThis is a possible type ofElement .static intCCITT_BLACKIS1A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels,static intCCITT_ENCODEDBYTEALIGNA flag indicating whether the filter expects extra 0-bits before each encoded line so that the line begins on a byte boundary.static intCCITT_ENDOFBLOCKA flag indicating whether the filter expects the encoded data to be terminated by an end-of-block pattern, overriding the Rows parameter.static intCCITT_ENDOFLINEA flag indicating whether end-of-line bit patterns are required to be present in the encoding.static intCCITTG3_1DPure one-dimensional encoding (Group 3, 1-D)static intCCITTG3_2DMixed one- and two-dimensional encoding (Group 3, 2-D)static intCCITTG4Pure two-dimensional encoding (Group 4)static intCELLThis is a possible type ofElement.static intCHAPTERThis is a possible type ofElementstatic intCHUNKThis is a possible type ofElement.static intCREATIONDATEThis is a possible type ofElement .static intCREATORThis is a possible type ofElement .static intHEADERThis is a possible type ofElement.static intIMGRAWThis is a possible type ofElement.static intIMGTEMPLATEThis is a possible type ofElement.static intJBIG2This is a possible type ofElement.static intJPEGThis is a possible type ofElement.static intJPEG2000This is a possible type ofElement.static intKEYWORDSThis is a possible type ofElement.static intLISTThis is a possible type ofElementstatic intLISTITEMThis is a possible type ofElementstatic intMARKEDThis is a possible type ofElement.static intMULTI_COLUMN_TEXTThis is a possible type ofElement.static intPARAGRAPHThis is a possible type ofElement.static intPHRASEThis is a possible type ofElement.static intPRODUCERThis is a possible type ofElement .static intPTABLEThis is a possible type ofElement.static intRECTANGLEThis is a possible type ofElement.static intROWThis is a possible type ofElement.static intSECTIONThis is a possible type ofElementstatic intSUBJECTThis is a possible type ofElement.static intTABLEThis is a possible type ofElement.static intTITLEThis is a possible type ofElement.static intYMARKThis is a possible type ofElement.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.ArrayListgetChunks()Gets all the chunks in this element.booleanisContent()Checks if this element is a content object.booleanisNestable()Checks if this element is nestable.booleanprocess(ElementListener listener)Processes the element by adding it (or the different parts) to anElementListener.java.lang.StringtoString()Gets the content of the text element.inttype()Gets the type of the text element.
-
-
-
Field Detail
-
HEADER
static final int HEADER
This is a possible type ofElement.- See Also:
- Constant Field Values
-
TITLE
static final int TITLE
This is a possible type ofElement.- See Also:
- Constant Field Values
-
SUBJECT
static final int SUBJECT
This is a possible type ofElement.- See Also:
- Constant Field Values
-
KEYWORDS
static final int KEYWORDS
This is a possible type ofElement.- See Also:
- Constant Field Values
-
AUTHOR
static final int AUTHOR
This is a possible type ofElement .- See Also:
- Constant Field Values
-
PRODUCER
static final int PRODUCER
This is a possible type ofElement .- See Also:
- Constant Field Values
-
CREATIONDATE
static final int CREATIONDATE
This is a possible type ofElement .- See Also:
- Constant Field Values
-
CREATOR
static final int CREATOR
This is a possible type ofElement .- See Also:
- Constant Field Values
-
CHUNK
static final int CHUNK
This is a possible type ofElement.- See Also:
- Constant Field Values
-
PHRASE
static final int PHRASE
This is a possible type ofElement.- See Also:
- Constant Field Values
-
PARAGRAPH
static final int PARAGRAPH
This is a possible type ofElement.- See Also:
- Constant Field Values
-
SECTION
static final int SECTION
This is a possible type ofElement- See Also:
- Constant Field Values
-
LIST
static final int LIST
This is a possible type ofElement- See Also:
- Constant Field Values
-
LISTITEM
static final int LISTITEM
This is a possible type ofElement- See Also:
- Constant Field Values
-
CHAPTER
static final int CHAPTER
This is a possible type ofElement- See Also:
- Constant Field Values
-
ANCHOR
static final int ANCHOR
This is a possible type ofElement- See Also:
- Constant Field Values
-
CELL
static final int CELL
This is a possible type ofElement.- See Also:
- Constant Field Values
-
ROW
static final int ROW
This is a possible type ofElement.- See Also:
- Constant Field Values
-
TABLE
static final int TABLE
This is a possible type ofElement.- See Also:
- Constant Field Values
-
PTABLE
static final int PTABLE
This is a possible type ofElement.- See Also:
- Constant Field Values
-
ANNOTATION
static final int ANNOTATION
This is a possible type ofElement.- See Also:
- Constant Field Values
-
RECTANGLE
static final int RECTANGLE
This is a possible type ofElement.- See Also:
- Constant Field Values
-
JPEG
static final int JPEG
This is a possible type ofElement.- See Also:
- Constant Field Values
-
JPEG2000
static final int JPEG2000
This is a possible type ofElement.- See Also:
- Constant Field Values
-
IMGRAW
static final int IMGRAW
This is a possible type ofElement.- See Also:
- Constant Field Values
-
IMGTEMPLATE
static final int IMGTEMPLATE
This is a possible type ofElement.- See Also:
- Constant Field Values
-
JBIG2
static final int JBIG2
This is a possible type ofElement.- Since:
- 2.1.5
- See Also:
- Constant Field Values
-
MULTI_COLUMN_TEXT
static final int MULTI_COLUMN_TEXT
This is a possible type ofElement.- See Also:
- Constant Field Values
-
MARKED
static final int MARKED
This is a possible type ofElement.- See Also:
- Constant Field Values
-
YMARK
static final int YMARK
This is a possible type ofElement.- Since:
- 2.1.2
- See Also:
- Constant Field Values
-
ALIGN_UNDEFINED
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.- See Also:
- Constant Field Values
-
ALIGN_LEFT
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.- See Also:
- Constant Field Values
-
ALIGN_CENTER
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.- See Also:
- Constant Field Values
-
ALIGN_RIGHT
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.- See Also:
- Constant Field Values
-
ALIGN_JUSTIFIED
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.- See Also:
- Constant Field Values
-
ALIGN_TOP
static final int ALIGN_TOP
A possible value for vertical alignment.- See Also:
- Constant Field Values
-
ALIGN_MIDDLE
static final int ALIGN_MIDDLE
A possible value for vertical alignment.- See Also:
- Constant Field Values
-
ALIGN_BOTTOM
static final int ALIGN_BOTTOM
A possible value for vertical alignment.- See Also:
- Constant Field Values
-
ALIGN_BASELINE
static final int ALIGN_BASELINE
A possible value for vertical alignment.- See Also:
- Constant Field Values
-
ALIGN_JUSTIFIED_ALL
static final int ALIGN_JUSTIFIED_ALL
Does the same as ALIGN_JUSTIFIED but the last line is also spread out.- See Also:
- Constant Field Values
-
CCITTG4
static final int CCITTG4
Pure two-dimensional encoding (Group 4)- See Also:
- Constant Field Values
-
CCITTG3_1D
static final int CCITTG3_1D
Pure one-dimensional encoding (Group 3, 1-D)- See Also:
- Constant Field Values
-
CCITTG3_2D
static final int CCITTG3_2D
Mixed one- and two-dimensional encoding (Group 3, 2-D)- See Also:
- Constant Field Values
-
CCITT_BLACKIS1
static final int CCITT_BLACKIS1
A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels,- See Also:
- Constant Field Values
-
CCITT_ENCODEDBYTEALIGN
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.- See Also:
- Constant Field Values
-
CCITT_ENDOFLINE
static final int CCITT_ENDOFLINE
A flag indicating whether end-of-line bit patterns are required to be present in the encoding.- See Also:
- Constant Field Values
-
CCITT_ENDOFBLOCK
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.- See Also:
- Constant Field Values
-
-
Method Detail
-
process
boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to anElementListener.- Parameters:
listener- anElementListener- Returns:
trueif the element was processed successfully
-
type
int type()
Gets the type of the text element.- Returns:
- a type
-
isContent
boolean isContent()
Checks if this element is a content object. If not, it's a metadata object.- Returns:
- true if this is a 'content' element; false if this is a 'metadata' element
- Since:
- iText 2.0.8
-
isNestable
boolean isNestable()
Checks if this element is nestable.- Returns:
- true if this element can be nested inside other elements.
- Since:
- iText 2.0.8
-
getChunks
java.util.ArrayList getChunks()
Gets all the chunks in this element.- Returns:
- an
ArrayList
-
toString
java.lang.String toString()
Gets the content of the text element.- Overrides:
toStringin classjava.lang.Object- Returns:
- a type
-
-