| Constructor: |
public Paragraph() {
super();
}
|
public Paragraph(float leading) {
super(leading);
}
Constructs a Paragraph with a certain leading. Parameters:
leading - the leading
|
public Paragraph(Chunk chunk) {
super(chunk);
}
Constructs a Paragraph with a certain Chunk. Parameters:
chunk - a Chunk
|
public Paragraph(String string) {
super(string);
}
Constructs a Paragraph with a certain String. Parameters:
string - a String
|
public Paragraph(Phrase phrase) {
super(phrase);
if (phrase instanceof Paragraph) {
Paragraph p = (Paragraph)phrase;
setAlignment(p.alignment);
setLeading(phrase.getLeading(), p.multipliedLeading);
setIndentationLeft(p.getIndentationLeft());
setIndentationRight(p.getIndentationRight());
setFirstLineIndent(p.getFirstLineIndent());
setSpacingAfter(p.spacingAfter());
setSpacingBefore(p.spacingBefore());
setExtraParagraphSpace(p.getExtraParagraphSpace());
}
}
Constructs a Paragraph with a certain Phrase. Parameters:
phrase - a Phrase
|
public Paragraph(float leading,
Chunk chunk) {
super(leading, chunk);
}
Constructs a Paragraph with a certain Chunk
and a certain leading. Parameters:
leading - the leading
chunk - a Chunk
|
public Paragraph(String string,
Font font) {
super(string, font);
}
Constructs a Paragraph with a certain String
and a certain Font. Parameters:
string - a String
font - a Font
|
public Paragraph(float leading,
String string) {
super(leading, string);
}
Constructs a Paragraph with a certain String
and a certain leading. Parameters:
leading - the leading
string - a String
|
public Paragraph(float leading,
String string,
Font font) {
super(leading, string, font);
}
Constructs a Paragraph with a certain leading, String
and Font. Parameters:
leading - the leading
string - a String
font - a Font
|
| Method from com.lowagie.text.Paragraph Detail: |
public boolean add(Object o) {
if (o instanceof List) {
List list = (List) o;
list.setIndentationLeft(list.getIndentationLeft() + indentationLeft);
list.setIndentationRight(indentationRight);
return super.add(list);
}
else if (o instanceof Image) {
super.addSpecial(o);
return true;
}
else if (o instanceof Paragraph) {
super.add(o);
java.util.List chunks = getChunks();
if (!chunks.isEmpty()) {
Chunk tmp = ((Chunk) chunks.get(chunks.size() - 1));
super.add(new Chunk("\n", tmp.getFont()));
}
else {
super.add(Chunk.NEWLINE);
}
return true;
}
return super.add(o);
}
Adds an Object to the Paragraph. |
public int getAlignment() {
return alignment;
}
Gets the alignment of this paragraph. |
public float getExtraParagraphSpace() {
return this.extraParagraphSpace;
}
Getter for property extraParagraphSpace. |
public float getFirstLineIndent() {
return this.firstLineIndent;
}
Getter for property firstLineIndent. |
public float getIndentationLeft() {
return indentationLeft;
}
Gets the indentation of this paragraph on the left side. |
public float getIndentationRight() {
return indentationRight;
}
Gets the indentation of this paragraph on the right side. |
public boolean getKeepTogether() {
return keeptogether;
}
Checks if this paragraph has to be kept together on one page. |
public float getMultipliedLeading() {
return multipliedLeading;
}
Gets the variable leading |
public float getSpacingAfter() {
return spacingAfter;
}
Gets the spacing after this paragraph. |
public float getSpacingBefore() {
return spacingBefore;
}
Gets the spacing before this paragraph. |
public float getTotalLeading() {
float m = font == null ?
Font.DEFAULTSIZE * multipliedLeading : font.getCalculatedLeading(multipliedLeading);
if (m > 0 && !hasLeading()) {
return m;
}
return getLeading() + m;
}
Gets the total leading.
This method is based on the assumption that the
font of the Paragraph is the font of all the elements
that make part of the paragraph. This isn't necessarily
true. |
public void setAlignment(int alignment) {
this.alignment = alignment;
}
Sets the alignment of this paragraph. |
public void setAlignment(String alignment) {
if (ElementTags.ALIGN_CENTER.equalsIgnoreCase(alignment)) {
this.alignment = Element.ALIGN_CENTER;
return;
}
if (ElementTags.ALIGN_RIGHT.equalsIgnoreCase(alignment)) {
this.alignment = Element.ALIGN_RIGHT;
return;
}
if (ElementTags.ALIGN_JUSTIFIED.equalsIgnoreCase(alignment)) {
this.alignment = Element.ALIGN_JUSTIFIED;
return;
}
if (ElementTags.ALIGN_JUSTIFIED_ALL.equalsIgnoreCase(alignment)) {
this.alignment = Element.ALIGN_JUSTIFIED_ALL;
return;
}
this.alignment = Element.ALIGN_LEFT;
}
Sets the alignment of this paragraph. |
public void setExtraParagraphSpace(float extraParagraphSpace) {
this.extraParagraphSpace = extraParagraphSpace;
}
Setter for property extraParagraphSpace. |
public void setFirstLineIndent(float firstLineIndent) {
this.firstLineIndent = firstLineIndent;
}
Setter for property firstLineIndent. |
public void setIndentationLeft(float indentation) {
this.indentationLeft = indentation;
}
Sets the indentation of this paragraph on the left side. |
public void setIndentationRight(float indentation) {
this.indentationRight = indentation;
}
Sets the indentation of this paragraph on the right side. |
public void setKeepTogether(boolean keeptogether) {
this.keeptogether = keeptogether;
}
Indicates that the paragraph has to be kept together on one page. |
public void setLeading(float fixedLeading) {
this.leading = fixedLeading;
this.multipliedLeading = 0;
}
|
public void setLeading(float fixedLeading,
float multipliedLeading) {
this.leading = fixedLeading;
this.multipliedLeading = multipliedLeading;
}
Sets the leading fixed and variable. The resultant leading will be
fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the
size of the biggest font in the line. |
public void setMultipliedLeading(float multipliedLeading) {
this.leading = 0;
this.multipliedLeading = multipliedLeading;
}
Sets the variable leading. The resultant leading will be
multipliedLeading*maxFontSize where maxFontSize is the
size of the biggest font in the line. |
public void setSpacingAfter(float spacing) {
this.spacingAfter = spacing;
}
Sets the spacing after this paragraph. |
public void setSpacingBefore(float spacing) {
this.spacingBefore = spacing;
}
Sets the spacing before this paragraph. |
public float spacingAfter() {
return spacingAfter;
} Deprecated! As - of iText 2.1.5, replaced by #getSpacingAfter() ,
scheduled for removal at 2.3.0
Gets the spacing after this paragraph. |
public float spacingBefore() {
return getSpacingBefore();
} Deprecated! As - of iText 2.1.5, replaced by #getSpacingBefore() ,
scheduled for removal at 2.3.0
Gets the spacing before this paragraph. |
public int type() {
return Element.PARAGRAPH;
}
Gets the type of the text element. |