Package com.lowagie.text.rtf
Class RtfAddableElement
java.lang.Object
com.lowagie.text.Chunk
com.lowagie.text.rtf.RtfAddableElement
- All Implemented Interfaces:
com.lowagie.text.Element,RtfBasicElement
- Direct Known Subclasses:
RtfDirectContent,RtfShape,RtfShapePosition,RtfShapeProperty,RtfTab,RtfTabGroup
The RtfAddableElement is the superclass for all rtf specific elements
that need to be added to an iText document. It is an extension of Chunk
and it also implements RtfBasicElement. It is an abstract class thus it
cannot be instantiated itself and has to be subclassed to be used.
- Version:
- $Id:RtfAddableElement.java 3126 2008-02-07 20:30:46Z hallm $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RtfDocumentThe RtfDocument this RtfAddableElement belongs to.protected booleanWhether this RtfAddableElement is contained in a header.protected booleanWhether this RtfAddableElement is contained in a table.Fields inherited from class com.lowagie.text.Chunk
ACTION, attributes, BACKGROUND, CHAR_SPACING, COLOR, content, ENCODING, font, GENERICTAG, HSCALE, HYPHENATION, IMAGE, LOCALDESTINATION, LOCALGOTO, NEWLINE, NEWPAGE, NEXTPAGE, OBJECT_REPLACEMENT_CHARACTER, PDFANNOTATION, REMOTEGOTO, SEPARATOR, SKEW, SPLITCHARACTER, SUBSUPSCRIPT, TAB, TEXTRENDERMODE, UNDERLINEFields 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, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARKFields inherited from interface com.lowagie.text.rtf.RtfBasicElement
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]intToByteArray(int i) Transforms an integer into its String representation and then returns the bytes of that string.booleanisEmpty()RtfAddableElement subclasses are never assumed to be empty.voidsetInHeader(boolean inHeader) Sets whether this RtfAddableElement is contained in a header/footer.voidsetInTable(boolean inTable) Sets whether this RtfAddableElement is contained in a table.voidSets the RtfDocument this RtfAddableElement belongs to.abstract voidwriteContent(OutputStream out) Writes the element content to the given output stream.Methods inherited from class com.lowagie.text.Chunk
append, getCharacterSpacing, getChunkAttributes, getChunks, getContent, getFont, getHorizontalScaling, getHyphenation, getImage, getTextRise, getWidthPoint, hasAttributes, isContent, isNestable, process, setAction, setAnchor, setAnchor, setAnnotation, setBackground, setBackground, setCharacterSpacing, setChunkAttributes, setFont, setGenericTag, setHorizontalScaling, setHyphenation, setLocalDestination, setLocalGoto, setNewPage, setRemoteGoto, setRemoteGoto, setSkew, setSplitCharacter, setTextRenderMode, setTextRise, setUnderline, setUnderline, toString, type
-
Field Details
-
doc
The RtfDocument this RtfAddableElement belongs to. -
inTable
protected boolean inTableWhether this RtfAddableElement is contained in a table. -
inHeader
protected boolean inHeaderWhether this RtfAddableElement is contained in a header.
-
-
Constructor Details
-
RtfAddableElement
public RtfAddableElement()Constructs a new RtfAddableElement. The Chunk content is set to an empty string and the font to the default Font().
-
-
Method Details
-
writeContent
Writes the element content to the given output stream.- Specified by:
writeContentin interfaceRtfBasicElement- Parameters:
out- TheOutputStreamto write the content to- Throws:
IOException
-
setRtfDocument
Sets the RtfDocument this RtfAddableElement belongs to.- Specified by:
setRtfDocumentin interfaceRtfBasicElement- Parameters:
doc- The @link{com.lowagie.text.rtf.document.RtfDocument} thisRtfElementbelongs to
-
setInTable
public void setInTable(boolean inTable) Sets whether this RtfAddableElement is contained in a table.- Specified by:
setInTablein interfaceRtfBasicElement- Parameters:
inTable- Whether this RtfBasicElement is in a table
-
setInHeader
public void setInHeader(boolean inHeader) Sets whether this RtfAddableElement is contained in a header/footer.- Specified by:
setInHeaderin interfaceRtfBasicElement- Parameters:
inHeader- Whether this RtfBasicElement is in a header
-
intToByteArray
public byte[] intToByteArray(int i) Transforms an integer into its String representation and then returns the bytes of that string.- Parameters:
i- The integer to convert- Returns:
- A byte array representing the integer
-
isEmpty
public boolean isEmpty()RtfAddableElement subclasses are never assumed to be empty.- Overrides:
isEmptyin classcom.lowagie.text.Chunk
-