com.lowagie.text.rtf.text
Class RtfParagraph

java.lang.Object
  extended bycom.lowagie.text.rtf.RtfElement
      extended bycom.lowagie.text.rtf.text.RtfPhrase
          extended bycom.lowagie.text.rtf.text.RtfParagraph
All Implemented Interfaces:
RtfBasicElement
Direct Known Subclasses:
RtfListItem

public class RtfParagraph
extends RtfPhrase

The RtfParagraph is an extension of the RtfPhrase that adds alignment and indentation properties. It wraps a Paragraph.

Version:
$Revision: 1.19 $
Author:
Mark Hall (mhall@edu.uni-klu.ac.at)

Field Summary
static byte[] ALIGN_CENTER
          Constant for center alignment
static byte[] ALIGN_JUSTIFY
          Constant for justified alignment
static byte[] ALIGN_LEFT
          Constant for left alignment
static byte[] ALIGN_RIGHT
          Constant for right alignment
private  int alignment
          The alignment of this RtfParagraph
static byte[] INDENT_LEFT
          Constant for left indentation
static byte[] INDENT_RIGHT
          Constant for right indentation
private  int indentLeft
          The left indentation of this RtfParagraph
private  int indentRight
          The right indentation of this RtfParagraph
static byte[] KEEP_TOGETHER
          Constant for keeping the paragraph together on one page
static byte[] KEEP_TOGETHER_WITH_NEXT
          Constant for keeping the paragraph toghether with the next one on one page
private  boolean keepTogether
          Whether this RtfParagraph must stay on one page.
private  boolean keepTogetherWithNext
          Whether this RtfParagraph must stay on the same page as the next paragraph.
static byte[] PARAGRAPH
          Constant for the end of a paragraph
private static byte[] SPACING_AFTER
          Constant for the space after the paragraph.
private static byte[] SPACING_BEFORE
          Constant for the space before the paragraph.
private  int spacingAfter
          The space after this paragraph.
private  int spacingBefore
          The space before this paragraph.
 
Fields inherited from class com.lowagie.text.rtf.text.RtfPhrase
chunks, IN_TABLE, LINE_SPACING, lineLeading, PARAGRAPH_DEFAULTS
 
Fields inherited from class com.lowagie.text.rtf.RtfElement
document, inHeader, inTable
 
Fields inherited from interface com.lowagie.text.rtf.RtfBasicElement
CLOSE_GROUP, COMMA_DELIMITER, DELIMITER, OPEN_GROUP, TWIPS_FACTOR
 
Constructor Summary
RtfParagraph(RtfDocument doc, Paragraph paragraph)
          Constructs a RtfParagraph belonging to a RtfDocument based on a Paragraph.
 
Method Summary
 int getIndentLeft()
          Gets the left indentation of this RtfParagraph.
 int getIndentRight()
          Gets the right indentation of this RtfParagraph.
 void setIndentLeft(int indentLeft)
          Sets the left indentation of this RtfParagraph.
 void setIndentRight(int indentRight)
          Sets the right indentation of this RtfParagraph.
 void setKeepTogetherWithNext(boolean keepTogetherWithNext)
          Set whether this RtfParagraph must stay on the same page as the next one.
 byte[] write()
          Writes the content of this RtfParagraph.
 
Methods inherited from class com.lowagie.text.rtf.text.RtfPhrase
setInHeader, setInTable, setRtfDocument
 
Methods inherited from class com.lowagie.text.rtf.RtfElement
intToByteArray, isInTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAGRAPH

public static final byte[] PARAGRAPH
Constant for the end of a paragraph


ALIGN_LEFT

public static final byte[] ALIGN_LEFT
Constant for left alignment


ALIGN_RIGHT

public static final byte[] ALIGN_RIGHT
Constant for right alignment


ALIGN_CENTER

public static final byte[] ALIGN_CENTER
Constant for center alignment


ALIGN_JUSTIFY

public static final byte[] ALIGN_JUSTIFY
Constant for justified alignment


INDENT_LEFT

public static final byte[] INDENT_LEFT
Constant for left indentation


INDENT_RIGHT

public static final byte[] INDENT_RIGHT
Constant for right indentation


KEEP_TOGETHER

public static final byte[] KEEP_TOGETHER
Constant for keeping the paragraph together on one page


KEEP_TOGETHER_WITH_NEXT

public static final byte[] KEEP_TOGETHER_WITH_NEXT
Constant for keeping the paragraph toghether with the next one on one page


SPACING_BEFORE

private static final byte[] SPACING_BEFORE
Constant for the space before the paragraph.


SPACING_AFTER

private static final byte[] SPACING_AFTER
Constant for the space after the paragraph.


alignment

private int alignment
The alignment of this RtfParagraph


indentLeft

private int indentLeft
The left indentation of this RtfParagraph


indentRight

private int indentRight
The right indentation of this RtfParagraph


keepTogether

private boolean keepTogether
Whether this RtfParagraph must stay on one page.


keepTogetherWithNext

private boolean keepTogetherWithNext
Whether this RtfParagraph must stay on the same page as the next paragraph.


spacingBefore

private int spacingBefore
The space before this paragraph.


spacingAfter

private int spacingAfter
The space after this paragraph.

Constructor Detail

RtfParagraph

public RtfParagraph(RtfDocument doc,
                    Paragraph paragraph)
Constructs a RtfParagraph belonging to a RtfDocument based on a Paragraph.

Parameters:
doc - The RtfDocument this RtfParagraph belongs to
paragraph - The Paragraph that this RtfParagraph is based on
Method Detail

setKeepTogetherWithNext

public void setKeepTogetherWithNext(boolean keepTogetherWithNext)
Set whether this RtfParagraph must stay on the same page as the next one.

Parameters:
keepTogetherWithNext - Whether this RtfParagraph must keep together with the next.

write

public byte[] write()
Writes the content of this RtfParagraph. First paragraph specific data is written and then the RtfChunks of this RtfParagraph are added.

Specified by:
write in interface RtfBasicElement
Overrides:
write in class RtfPhrase
Returns:
The content of this RtfParagraph

getIndentLeft

public int getIndentLeft()
Gets the left indentation of this RtfParagraph.

Returns:
The left indentation.

setIndentLeft

public void setIndentLeft(int indentLeft)
Sets the left indentation of this RtfParagraph.

Parameters:
indentLeft - The left indentation to use.

getIndentRight

public int getIndentRight()
Gets the right indentation of this RtfParagraph.

Returns:
The right indentation.

setIndentRight

public void setIndentRight(int indentRight)
Sets the right indentation of this RtfParagraph.

Parameters:
indentRight - The right indentation to use.