Save This Page
Home » iText-2.1.7 » com.lowagie » text » [javadoc | source]
com.lowagie.text
public class: Paragraph [javadoc | source]
java.lang.Object
   java.util.AbstractCollection
      java.util.AbstractList
         java.util.ArrayList
            com.lowagie.text.Phrase
               com.lowagie.text.Paragraph

All Implemented Interfaces:
    TextElementArray, List, Serializable, RandomAccess, Cloneable, Collection

Direct Known Subclasses:
    ListItem

A Paragraph is a series of Chunks and/or Phrases.

A Paragraph has the same qualities of a Phrase, but also some additional layout-parameters:

Example:
Paragraph p = new Paragraph("This is a paragraph",
              FontFactory.getFont(FontFactory.HELVETICA, 18, Font.BOLDITALIC, new Color(0, 0, 255)));
Field Summary
protected  int alignment    The alignment of the text. 
protected  float multipliedLeading    The text leading that is multiplied by the biggest font size in the line. 
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  float spacingBefore    The spacing before the paragraph. 
protected  float spacingAfter    The spacing after the paragraph. 
protected  boolean keeptogether    Does the paragraph has to be kept together on 1 page. 
Fields inherited from com.lowagie.text.Phrase:
leading,  font,  hyphenation
Fields inherited from java.util.AbstractList:
modCount
Constructor:
 public Paragraph() 
 public Paragraph(float leading) 
 public Paragraph(Chunk chunk) 
    Constructs a Paragraph with a certain Chunk.
    Parameters:
    chunk - a Chunk
 public Paragraph(String string) 
    Constructs a Paragraph with a certain String.
    Parameters:
    string - a String
 public Paragraph(Phrase phrase) 
    Constructs a Paragraph with a certain Phrase.
    Parameters:
    phrase - a Phrase
 public Paragraph(float leading,
    Chunk 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) 
    Constructs a Paragraph with a certain String and a certain Font.
    Parameters:
    string - a String
    font - a Font
 public Paragraph(float leading,
    String 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) 
    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 Summary:
add,   getAlignment,   getExtraParagraphSpace,   getFirstLineIndent,   getIndentationLeft,   getIndentationRight,   getKeepTogether,   getMultipliedLeading,   getSpacingAfter,   getSpacingBefore,   getTotalLeading,   setAlignment,   setAlignment,   setExtraParagraphSpace,   setFirstLineIndent,   setIndentationLeft,   setIndentationRight,   setKeepTogether,   setLeading,   setLeading,   setMultipliedLeading,   setSpacingAfter,   setSpacingBefore,   spacingAfter,   spacingBefore,   type
Methods from com.lowagie.text.Phrase:
add,   add,   addAll,   addChunk,   addSpecial,   getChunks,   getContent,   getFont,   getHyphenation,   getInstance,   getInstance,   getInstance,   getLeading,   hasLeading,   isContent,   isEmpty,   isNestable,   process,   setFont,   setHyphenation,   setLeading,   type
Methods from java.util.ArrayList:
add,   add,   addAll,   addAll,   clear,   clone,   contains,   ensureCapacity,   get,   indexOf,   isEmpty,   lastIndexOf,   remove,   remove,   removeRange,   set,   size,   toArray,   toArray,   trimToSize
Methods from java.util.AbstractList:
add,   add,   addAll,   clear,   equals,   get,   hashCode,   indexOf,   iterator,   lastIndexOf,   listIterator,   listIterator,   remove,   removeRange,   set,   subList
Methods from java.util.AbstractCollection:
add,   addAll,   clear,   contains,   containsAll,   isEmpty,   iterator,   remove,   removeAll,   retainAll,   size,   toArray,   toArray,   toString
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.Paragraph Detail:
 public boolean add(Object o) 
    Adds an Object to the Paragraph.
 public int getAlignment() 
    Gets the alignment of this paragraph.
 public float getExtraParagraphSpace() 
    Getter for property extraParagraphSpace.
 public float getFirstLineIndent() 
    Getter for property firstLineIndent.
 public float getIndentationLeft() 
    Gets the indentation of this paragraph on the left side.
 public float getIndentationRight() 
    Gets the indentation of this paragraph on the right side.
 public boolean getKeepTogether() 
    Checks if this paragraph has to be kept together on one page.
 public float getMultipliedLeading() 
    Gets the variable leading
 public float getSpacingAfter() 
    Gets the spacing after this paragraph.
 public float getSpacingBefore() 
    Gets the spacing before this paragraph.
 public float getTotalLeading() 
    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) 
    Sets the alignment of this paragraph.
 public  void setAlignment(String alignment) 
    Sets the alignment of this paragraph.
 public  void setExtraParagraphSpace(float extraParagraphSpace) 
    Setter for property extraParagraphSpace.
 public  void setFirstLineIndent(float firstLineIndent) 
    Setter for property firstLineIndent.
 public  void setIndentationLeft(float indentation) 
    Sets the indentation of this paragraph on the left side.
 public  void setIndentationRight(float indentation) 
    Sets the indentation of this paragraph on the right side.
 public  void setKeepTogether(boolean keeptogether) 
    Indicates that the paragraph has to be kept together on one page.
 public  void setLeading(float fixedLeading) 
 public  void setLeading(float fixedLeading,
    float 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) 
    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) 
    Sets the spacing after this paragraph.
 public  void setSpacingBefore(float spacing) 
    Sets the spacing before this paragraph.
 public float 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() 
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() 
    Gets the type of the text element.