Class NoNewLineParagraph
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Element>
com.itextpdf.text.Phrase
com.itextpdf.tool.xml.html.pdfelement.NoNewLineParagraph
- All Implemented Interfaces:
Indentable
,Element
,TextElementArray
,Serializable
,Cloneable
,Iterable<Element>
,Collection<Element>
,List<Element>
,RandomAccess
A
NoNewLineParagraph
is a series of Chunk
s and/or Phrases
.
A NoNewLineParagraph
has the same qualities of a Phrase
, but also
some additional layout-parameters:
- the indentation
- the alignment of the text
NoNewLineParagraph p = new NoNewLineParagraph("This is a paragraph", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
The alignment of the text.private float
Holds value of property extraParagraphSpace.private float
Holds value of property firstLineIndent.protected float
The indentation of this paragraph on the left side.protected float
The indentation of this paragraph on the right side.protected boolean
Does the paragraph has to be kept together on 1 page.private static final long
protected float
The spacing after the paragraph.protected float
The spacing before the paragraph.Fields inherited from class com.itextpdf.text.Phrase
font, hyphenation, leading, multipliedLeading, tabSettings
Fields inherited from class java.util.AbstractList
modCount
Fields inherited from interface com.itextpdf.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, BODY, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARK
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs aParagraph
.NoNewLineParagraph
(float leading) Constructs aParagraph
with a certain leading.NoNewLineParagraph
(float leading, Chunk chunk) Constructs aParagraph
with a certainChunk
and a certain leading.NoNewLineParagraph
(float leading, String string) Constructs aParagraph
with a certainString
and a certain leading.NoNewLineParagraph
(float leading, String string, Font font) Constructs aParagraph
with a certain leading,String
andFont
.NoNewLineParagraph
(Chunk chunk) Constructs aParagraph
with a certainChunk
.NoNewLineParagraph
(Phrase phrase) Constructs aParagraph
with a certainPhrase
.NoNewLineParagraph
(String string) Constructs aParagraph
with a certainString
.NoNewLineParagraph
(String string, Font font) Constructs aParagraph
with a certainString
and a certainFont
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds anElement
to theParagraph
.int
Gets the alignment of this paragraph.float
Getter for property extraParagraphSpace.float
Getter for property firstLineIndent.float
Gets the indentation of this paragraph on the left side.float
Gets the indentation of this paragraph on the right side.boolean
Checks if this paragraph has to be kept together on one page.float
Gets the spacing after this paragraph.float
Gets the spacing before this paragraph.void
setAlignment
(int 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
setSpacingAfter
(float spacing) Sets the spacing after this paragraph.void
setSpacingBefore
(float spacing) Sets the spacing before this paragraph.float
Deprecated.float
Deprecated.As of iText 2.1.5, replaced bygetSpacingBefore()
, scheduled for removal at 2.3.0Methods inherited from class com.itextpdf.text.Phrase
add, add, addAll, addChunk, addSpecial, getChunks, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, getMultipliedLeading, getTabSettings, getTotalLeading, hasLeading, isContent, isEmpty, isNestable, process, setFont, setHyphenation, setLeading, setLeading, setMultipliedLeading, setTabSettings, trim, type
Methods inherited from class java.util.ArrayList
addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
alignment
protected int alignmentThe alignment of the text. -
indentationLeft
protected float indentationLeftThe indentation of this paragraph on the left side. -
indentationRight
protected float indentationRightThe indentation of this paragraph on the right side. -
firstLineIndent
private float firstLineIndentHolds value of property firstLineIndent. -
spacingBefore
protected float spacingBeforeThe spacing before the paragraph. -
spacingAfter
protected float spacingAfterThe spacing after the paragraph. -
extraParagraphSpace
private float extraParagraphSpaceHolds value of property extraParagraphSpace. -
keeptogether
protected boolean keeptogetherDoes the paragraph has to be kept together on 1 page.
-
-
Constructor Details
-
NoNewLineParagraph
public NoNewLineParagraph()Constructs aParagraph
. -
NoNewLineParagraph
public NoNewLineParagraph(float leading) Constructs aParagraph
with a certain leading.- Parameters:
leading
- the leading
-
NoNewLineParagraph
Constructs aParagraph
with a certainChunk
.- Parameters:
chunk
- aChunk
-
NoNewLineParagraph
Constructs aParagraph
with a certainChunk
and a certain leading.- Parameters:
leading
- the leadingchunk
- aChunk
-
NoNewLineParagraph
Constructs aParagraph
with a certainString
.- Parameters:
string
- aString
-
NoNewLineParagraph
Constructs aParagraph
with a certainString
and a certainFont
.- Parameters:
string
- aString
font
- aFont
-
NoNewLineParagraph
Constructs aParagraph
with a certainString
and a certain leading.- Parameters:
leading
- the leadingstring
- aString
-
NoNewLineParagraph
Constructs aParagraph
with a certain leading,String
andFont
.- Parameters:
leading
- the leadingstring
- aString
font
- aFont
-
NoNewLineParagraph
Constructs aParagraph
with a certainPhrase
.- Parameters:
phrase
- aPhrase
-
-
Method Details
-
add
Adds anElement
to theParagraph
.- Specified by:
add
in interfaceCollection<Element>
- Specified by:
add
in interfaceList<Element>
- Specified by:
add
in interfaceTextElementArray
- Overrides:
add
in classPhrase
- Parameters:
o
- the element to add.- Returns:
- true is adding the object succeeded
-
setAlignment
public void setAlignment(int alignment) Sets the alignment of this paragraph.- Parameters:
alignment
- the new alignment
-
setIndentationLeft
public void setIndentationLeft(float indentation) Sets the indentation of this paragraph on the left side.- Specified by:
setIndentationLeft
in interfaceIndentable
- Parameters:
indentation
- the new indentation
-
setIndentationRight
public void setIndentationRight(float indentation) Sets the indentation of this paragraph on the right side.- Specified by:
setIndentationRight
in interfaceIndentable
- Parameters:
indentation
- the new indentation
-
setFirstLineIndent
public void setFirstLineIndent(float firstLineIndent) Setter for property firstLineIndent.- Parameters:
firstLineIndent
- New value of property firstLineIndent.
-
setSpacingBefore
public void setSpacingBefore(float spacing) Sets the spacing before this paragraph.- Parameters:
spacing
- the new spacing
-
setSpacingAfter
public void setSpacingAfter(float spacing) Sets the spacing after this paragraph.- Parameters:
spacing
- the new spacing
-
setKeepTogether
public void setKeepTogether(boolean keeptogether) Indicates that the paragraph has to be kept together on one page.- Parameters:
keeptogether
- true of the paragraph may not be split over 2 pages
-
getKeepTogether
public boolean getKeepTogether()Checks if this paragraph has to be kept together on one page.- Returns:
- true if the paragraph may not be split over 2 pages.
-
getAlignment
public int getAlignment()Gets the alignment of this paragraph.- Returns:
- alignment
-
getIndentationLeft
public float getIndentationLeft()Gets the indentation of this paragraph on the left side.- Specified by:
getIndentationLeft
in interfaceIndentable
- Returns:
- the indentation
-
getIndentationRight
public float getIndentationRight()Gets the indentation of this paragraph on the right side.- Specified by:
getIndentationRight
in interfaceIndentable
- Returns:
- the indentation
-
getFirstLineIndent
public float getFirstLineIndent()Getter for property firstLineIndent.- Returns:
- Value of property firstLineIndent.
-
getSpacingBefore
public float getSpacingBefore()Gets the spacing before this paragraph.- Returns:
- the spacing
- Since:
- 2.1.5
-
getSpacingAfter
public float getSpacingAfter()Gets the spacing after this paragraph.- Returns:
- the spacing
- Since:
- 2.1.5
-
getExtraParagraphSpace
public float getExtraParagraphSpace()Getter for property extraParagraphSpace.- Returns:
- Value of property extraParagraphSpace.
-
setExtraParagraphSpace
public void setExtraParagraphSpace(float extraParagraphSpace) Setter for property extraParagraphSpace.- Parameters:
extraParagraphSpace
- New value of property extraParagraphSpace.
-
spacingBefore
Deprecated.As of iText 2.1.5, replaced bygetSpacingBefore()
, scheduled for removal at 2.3.0Gets the spacing before this paragraph.- Returns:
- the spacing
-
spacingAfter
Deprecated.As of iText 2.1.5, replaced bygetSpacingAfter()
, scheduled for removal at 2.3.0Gets the spacing after this paragraph.- Returns:
- the spacing
-
getSpacingAfter()
, scheduled for removal at 2.3.0