public class Paragraph extends Phrase implements TextElementArray, MarkupAttributes
Paragraph is a series of Chunks and/or Phrases.
A Paragraph has the same qualities of a Phrase, but also
some additional layout-parameters:
Paragraph p = new Paragraph("This is a paragraph",
FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));
Element,
Phrase,
ListItem,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected int |
alignment
The alignment of the text.
|
private float |
extraParagraphSpace
Holds value of property extraParagraphSpace.
|
private float |
firstLineIndent
Holds value of property firstLineIndent.
|
protected float |
indentationLeft
The indentation of this paragraph on the left side.
|
protected float |
indentationRight
The indentation of this paragraph on the right side.
|
protected boolean |
keeptogether
Does the paragraph has to be kept together on 1 page.
|
protected float |
multipliedLeading
The text leading that is multiplied by the biggest font size in the line.
|
protected float |
spacingAfter
The spacing after the paragraph.
|
protected float |
spacingBefore
The spacing before the paragraph.
|
font, leading, markupAttributesALIGN_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, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE| Constructor and Description |
|---|
Paragraph()
Constructs a
Paragraph. |
Paragraph(Chunk chunk)
Constructs a
Paragraph with a certain Chunk. |
Paragraph(float leading)
Constructs a
Paragraph with a certain leading. |
Paragraph(float leading,
Chunk chunk)
Constructs a
Paragraph with a certain Chunk
and a certain leading. |
Paragraph(float leading,
java.lang.String string)
Constructs a
Paragraph with a certain String
and a certain leading. |
Paragraph(float leading,
java.lang.String string,
Font font)
Constructs a
Paragraph with a certain leading, String
and Font. |
Paragraph(Phrase phrase)
Constructs a
Paragraph with a certain Phrase. |
Paragraph(java.util.Properties attributes)
Returns a
Paragraph that has been constructed taking in account
the value of some attributes. |
Paragraph(java.lang.String string)
Constructs a
Paragraph with a certain String. |
Paragraph(java.lang.String string,
Font font)
Constructs a
Paragraph with a certain String
and a certain Font. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Object o)
Adds an
Object to the Paragraph. |
int |
alignment()
Gets the alignment of this paragraph.
|
float |
getExtraParagraphSpace()
Getter for property extraParagraphSpace.
|
float |
getFirstLineIndent()
Getter for property firstLineIndent.
|
boolean |
getKeepTogether()
Checks if this paragraph has to be kept together on one page.
|
float |
getMultipliedLeading()
Gets the variable leading
|
float |
indentationLeft()
Gets the indentation of this paragraph on the left side.
|
float |
indentationRight()
Gets the indentation of this paragraph on the right side.
|
static boolean |
isTag(java.lang.String tag)
Checks if a given tag corresponds with this object.
|
void |
setAlignment(int alignment)
Sets the alignment of this paragraph.
|
void |
setAlignment(java.lang.String alignment)
Sets the alignment of this paragraph.
|
void |
setExtraParagraphSpace(float extraParagraphSpace)
Setter for property extraParagraphSpace.
|
void |
setFirstLineIndent(float firstLineIndent)
Setter for property firstLineIndent.
|
void |
setIndentationLeft(float indentation)
Sets the indentation of this paragraph on the left side.
|
void |
setIndentationRight(float indentation)
Sets the indentation of this paragraph on the right side.
|
void |
setKeepTogether(boolean keeptogether)
Indicates that the paragraph has to be kept together on one page.
|
void |
setLeading(float fixedLeading)
Sets the leading of this phrase.
|
void |
setLeading(float fixedLeading,
float multipliedLeading)
Sets the leading fixed and variable.
|
void |
setSpacingAfter(float spacing)
Sets the spacing after this paragraph.
|
void |
setSpacingBefore(float spacing)
Sets the spacing before this paragraph.
|
float |
spacingAfter()
Gets the spacing before this paragraph.
|
float |
spacingBefore()
Gets the spacing before this paragraph.
|
int |
type()
Gets the type of the text element.
|
add, addAll, addSpecial, content, font, getChunks, getInstance, getInstance, getInstance, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, isEmpty, leading, leadingDefined, process, setMarkupAttribute, setMarkupAttributesaddAll, clear, clone, contains, ensureCapacity, get, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSizefinalize, getClass, notify, notifyAll, wait, wait, waitgetMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, setMarkupAttribute, setMarkupAttributesprotected int alignment
protected float indentationLeft
protected float indentationRight
protected float spacingBefore
protected float spacingAfter
protected boolean keeptogether
protected float multipliedLeading
private float firstLineIndent
private float extraParagraphSpace
public Paragraph()
Paragraph.public Paragraph(float leading)
Paragraph with a certain leading.leading - the leadingpublic Paragraph(Chunk chunk)
Paragraph with a certain Chunk.chunk - a Chunkpublic Paragraph(float leading,
Chunk chunk)
Paragraph with a certain Chunk
and a certain leading.leading - the leadingchunk - a Chunkpublic Paragraph(java.lang.String string)
Paragraph with a certain String.string - a Stringpublic Paragraph(java.lang.String string,
Font font)
Paragraph with a certain String
and a certain Font.string - a Stringfont - a Fontpublic Paragraph(float leading,
java.lang.String string)
Paragraph with a certain String
and a certain leading.leading - the leadingstring - a Stringpublic Paragraph(float leading,
java.lang.String string,
Font font)
Paragraph with a certain leading, String
and Font.leading - the leadingstring - a Stringfont - a Fontpublic Paragraph(Phrase phrase)
Paragraph with a certain Phrase.phrase - a Phrasepublic Paragraph(java.util.Properties attributes)
Paragraph that has been constructed taking in account
the value of some attributes.attributes - Some attributespublic int type()
public boolean add(java.lang.Object o)
Object to the Paragraph.add in interface TextElementArrayadd in interface java.util.Collectionadd in interface java.util.Listadd in class Phraseo - object the object to add.public void setAlignment(int alignment)
alignment - the new alignmentpublic void setAlignment(java.lang.String alignment)
alignment - the new alignment as a Stringpublic void setIndentationLeft(float indentation)
indentation - the new indentationpublic void setIndentationRight(float indentation)
indentation - the new indentationpublic void setSpacingBefore(float spacing)
spacing - the new spacingpublic void setSpacingAfter(float spacing)
spacing - the new spacingpublic void setKeepTogether(boolean keeptogether)
keeptogether - true of the paragraph may not be split over 2 pagespublic boolean getKeepTogether()
public int alignment()
public float indentationLeft()
public float indentationRight()
public float spacingBefore()
public float spacingAfter()
public static boolean isTag(java.lang.String tag)
tag - the given tagpublic void setLeading(float fixedLeading,
float multipliedLeading)
fixedLeading - the fixed leadingmultipliedLeading - the variable leadingpublic void setLeading(float fixedLeading)
PhrasesetLeading in class PhrasefixedLeading - the new leadingPhrase.setLeading(float)public float getMultipliedLeading()
public float getFirstLineIndent()
public void setFirstLineIndent(float firstLineIndent)
firstLineIndent - New value of property firstLineIndent.public float getExtraParagraphSpace()
public void setExtraParagraphSpace(float extraParagraphSpace)
extraParagraphSpace - New value of property extraParagraphSpace.