Indentable
, Element
, TextElementArray
, java.io.Serializable
, java.lang.Cloneable
, java.lang.Iterable<Element>
, java.util.Collection<Element>
, java.util.List<Element>
, java.util.RandomAccess
public class NoNewLineParagraph extends Phrase implements Indentable
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:
NoNewLineParagraph p = new NoNewLineParagraph("This is a paragraph", FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));
Element
,
Phrase
,
ListItem
,
Serialized FormModifier and Type | Field | Description |
---|---|---|
protected int |
alignment |
The alignment of the text.
|
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 |
spacingAfter |
The spacing after the paragraph.
|
protected float |
spacingBefore |
The spacing before the paragraph.
|
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
font, hyphenation, leading, multipliedLeading, tabSettings
Constructor | Description |
---|---|
NoNewLineParagraph() |
Constructs a
Paragraph . |
NoNewLineParagraph(float leading) |
Constructs a
Paragraph with a certain leading. |
NoNewLineParagraph(float leading,
Chunk chunk) |
Constructs a
Paragraph with a certain Chunk
and a certain leading. |
NoNewLineParagraph(float leading,
java.lang.String string) |
Constructs a
Paragraph with a certain String
and a certain leading. |
NoNewLineParagraph(float leading,
java.lang.String string,
Font font) |
Constructs a
Paragraph with a certain leading, String
and Font . |
NoNewLineParagraph(Chunk chunk) |
Constructs a
Paragraph with a certain Chunk . |
NoNewLineParagraph(Phrase phrase) |
Constructs a
Paragraph with a certain Phrase . |
NoNewLineParagraph(java.lang.String string) |
Constructs a
Paragraph with a certain String . |
NoNewLineParagraph(java.lang.String string,
Font font) |
Constructs a
Paragraph with a certain String
and a certain Font . |
Modifier and Type | Method | Description |
---|---|---|
boolean |
add(Element o) |
Adds an
Element to the Paragraph . |
int |
getAlignment() |
Gets the alignment of this paragraph.
|
float |
getExtraParagraphSpace() |
Getter for property extraParagraphSpace.
|
float |
getFirstLineIndent() |
Getter for property firstLineIndent.
|
float |
getIndentationLeft() |
Gets the indentation of this paragraph on the left side.
|
float |
getIndentationRight() |
Gets the indentation of this paragraph on the right side.
|
boolean |
getKeepTogether() |
Checks if this paragraph has to be kept together on one page.
|
float |
getSpacingAfter() |
Gets the spacing after this paragraph.
|
float |
getSpacingBefore() |
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 |
spacingAfter() |
Deprecated.
As of iText 2.1.5, replaced by
getSpacingAfter() ,
scheduled for removal at 2.3.0 |
float |
spacingBefore() |
Deprecated.
As of iText 2.1.5, replaced by
getSpacingBefore() ,
scheduled for removal at 2.3.0 |
addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
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
protected int alignment
protected float indentationLeft
protected float indentationRight
protected float spacingBefore
protected float spacingAfter
protected boolean keeptogether
public NoNewLineParagraph()
Paragraph
.public NoNewLineParagraph(float leading)
Paragraph
with a certain leading.leading
- the leadingpublic NoNewLineParagraph(Chunk chunk)
Paragraph
with a certain Chunk
.chunk
- a Chunk
public NoNewLineParagraph(float leading, Chunk chunk)
Paragraph
with a certain Chunk
and a certain leading.leading
- the leadingchunk
- a Chunk
public NoNewLineParagraph(java.lang.String string)
Paragraph
with a certain String
.string
- a String
public NoNewLineParagraph(java.lang.String string, Font font)
Paragraph
with a certain String
and a certain Font
.string
- a String
font
- a Font
public NoNewLineParagraph(float leading, java.lang.String string)
Paragraph
with a certain String
and a certain leading.leading
- the leadingstring
- a String
public NoNewLineParagraph(float leading, java.lang.String string, Font font)
Paragraph
with a certain leading, String
and Font
.leading
- the leadingstring
- a String
font
- a Font
public NoNewLineParagraph(Phrase phrase)
Paragraph
with a certain Phrase
.phrase
- a Phrase
public boolean add(Element o)
Element
to the Paragraph
.public void setAlignment(int alignment)
alignment
- the new alignmentpublic void setIndentationLeft(float indentation)
setIndentationLeft
in interface Indentable
indentation
- the new indentationpublic void setIndentationRight(float indentation)
setIndentationRight
in interface Indentable
indentation
- the new indentationpublic void setFirstLineIndent(float firstLineIndent)
firstLineIndent
- New value of property firstLineIndent.public 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 getAlignment()
public float getIndentationLeft()
getIndentationLeft
in interface Indentable
public float getIndentationRight()
getIndentationRight
in interface Indentable
public float getFirstLineIndent()
public float getSpacingBefore()
public float getSpacingAfter()
public float getExtraParagraphSpace()
public void setExtraParagraphSpace(float extraParagraphSpace)
extraParagraphSpace
- New value of property extraParagraphSpace.@Deprecated public float spacingBefore()
getSpacingBefore()
,
scheduled for removal at 2.3.0@Deprecated public float spacingAfter()
getSpacingAfter()
,
scheduled for removal at 2.3.0Copyright © 1998–2018. All rights reserved.