com.lowagie.text.rtf
Class RtfRow

java.lang.Object
  extended bycom.lowagie.text.rtf.RtfRow

public class RtfRow
extends Object

A Helper Class for the RtfWriter.

Do not use it directly Parts of this Class were contributed by Steffen Stundzig. Many thanks for the improvements.


Field Summary
private  Color borderColor
          The border color of this RtfRow
private  int borders
          The borders of this RtfRow
private  float borderWidth
          The border width of this RtfRow
private  int cellpadding
          The default cellpadding of RtfCells in this RtfRow
private  ArrayList cells
          List of RtfCells in this RtfRow
private  int cellspacing
          The default cellspacing of RtfCells in this RtfRow
private static byte[] graphLeft
           
private  RtfTable mainTable
          The RtfTable to which this RtfRow belongs
private  Row origRow
          Original Row
private static byte[] rowAlignCenter
           
private static byte[] rowAlignLeft
           
private static byte[] rowAlignRight
           
private static byte[] rowAutofit
           
private static byte[] rowBegin
           
private static byte[] rowBorderBottom
           
private static byte[] rowBorderInlineHorizontal
           
private static byte[] rowBorderInlineVertical
           
private static byte[] rowBorderLeft
           
private static byte[] rowBorderRight
           
private static byte[] rowBorderTop
           
private static byte[] rowEnd
           
private static byte[] rowHeader
          Table row header.
private static byte[] rowKeep
          Table row keep together.
private static byte[] rowPaddingLeft
           
private static byte[] rowPaddingLeftStyle
           
private static byte[] rowPaddingRight
           
private static byte[] rowPaddingRightStyle
           
private static byte[] rowSpacingBottom
           
private static byte[] rowSpacingBottomStyle
           
private static byte[] rowSpacingLeft
           
private static byte[] rowSpacingLeftStyle
           
private static byte[] rowSpacingRight
           
private static byte[] rowSpacingRightStyle
           
private static byte[] rowSpacingTop
           
private static byte[] rowSpacingTopStyle
           
private static byte[] rowWidth
           
private static byte[] rowWidthStyle
           
static byte[] tableBorder
           
static byte[] tableBorderColor
           
static byte[] tableBorderWidth
           
private  int width
          The width of this RtfRow (in percent)
private  RtfWriter writer
          The RtfWriter to which this RtfRow belongs
 
Constructor Summary
RtfRow(RtfWriter writer, RtfTable mainTable)
          Create a new RtfRow.
 
Method Summary
 boolean importRow(Row row, float[] propWidths, int tableWidth, int pageWidth, int cellpadding, int cellspacing, int borders, Color borderColor, float borderWidth, int y)
          Import a Row.
 void pregenerateRows(int columns)
          Pregenerate the RtfCells in this RtfRow.
 void setMerge(int x, int mergeType, RtfCell mergeCell)
          RtfTables call this method from their own setMerge() to specify that a certain other cell is to be merged with it.
private  void writeBorder(ByteArrayOutputStream os, byte[] borderType)
           
private  void writeInt(ByteArrayOutputStream out, int i)
           
 boolean writeRow(ByteArrayOutputStream os, int rowNum, Table table)
          Write the RtfRow to the specified OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableBorder

public static final byte[] tableBorder

tableBorderWidth

public static final byte[] tableBorderWidth

tableBorderColor

public static final byte[] tableBorderColor

rowBegin

private static final byte[] rowBegin

rowEnd

private static final byte[] rowEnd

rowAutofit

private static final byte[] rowAutofit

graphLeft

private static final byte[] graphLeft

rowBorderLeft

private static final byte[] rowBorderLeft

rowBorderRight

private static final byte[] rowBorderRight

rowBorderTop

private static final byte[] rowBorderTop

rowBorderBottom

private static final byte[] rowBorderBottom

rowBorderInlineHorizontal

private static final byte[] rowBorderInlineHorizontal

rowBorderInlineVertical

private static final byte[] rowBorderInlineVertical

rowSpacingLeft

private static final byte[] rowSpacingLeft

rowSpacingRight

private static final byte[] rowSpacingRight

rowSpacingTop

private static final byte[] rowSpacingTop

rowSpacingBottom

private static final byte[] rowSpacingBottom

rowSpacingLeftStyle

private static final byte[] rowSpacingLeftStyle

rowSpacingRightStyle

private static final byte[] rowSpacingRightStyle

rowSpacingTopStyle

private static final byte[] rowSpacingTopStyle

rowSpacingBottomStyle

private static final byte[] rowSpacingBottomStyle

rowPaddingLeft

private static final byte[] rowPaddingLeft

rowPaddingRight

private static final byte[] rowPaddingRight

rowPaddingLeftStyle

private static final byte[] rowPaddingLeftStyle

rowPaddingRightStyle

private static final byte[] rowPaddingRightStyle

rowWidthStyle

private static final byte[] rowWidthStyle

rowWidth

private static final byte[] rowWidth

rowHeader

private static final byte[] rowHeader
Table row header. This row should appear at the top of every page the current table appears on.


rowKeep

private static final byte[] rowKeep
Table row keep together. This row cannot be split by a page break. This property is assumed to be off unless the control word is present.


rowAlignLeft

private static final byte[] rowAlignLeft

rowAlignCenter

private static final byte[] rowAlignCenter

rowAlignRight

private static final byte[] rowAlignRight

cells

private ArrayList cells
List of RtfCells in this RtfRow


writer

private RtfWriter writer
The RtfWriter to which this RtfRow belongs


mainTable

private RtfTable mainTable
The RtfTable to which this RtfRow belongs


width

private int width
The width of this RtfRow (in percent)


cellpadding

private int cellpadding
The default cellpadding of RtfCells in this RtfRow


cellspacing

private int cellspacing
The default cellspacing of RtfCells in this RtfRow


borders

private int borders
The borders of this RtfRow


borderColor

private Color borderColor
The border color of this RtfRow


borderWidth

private float borderWidth
The border width of this RtfRow


origRow

private Row origRow
Original Row

Constructor Detail

RtfRow

public RtfRow(RtfWriter writer,
              RtfTable mainTable)
Create a new RtfRow.

Parameters:
writer - The RtfWriter that this RtfRow belongs to
mainTable - The RtfTable that created this RtfRow
Method Detail

pregenerateRows

public void pregenerateRows(int columns)
Pregenerate the RtfCells in this RtfRow.

Parameters:
columns - The number of RtfCells to be generated.

importRow

public boolean importRow(Row row,
                         float[] propWidths,
                         int tableWidth,
                         int pageWidth,
                         int cellpadding,
                         int cellspacing,
                         int borders,
                         Color borderColor,
                         float borderWidth,
                         int y)
Import a Row.

All the parameters are taken from the RtfTable which contains this RtfRow and they do exactely what they say

Parameters:
propWidths - in percent
tableWidth - in percent

writeRow

public boolean writeRow(ByteArrayOutputStream os,
                        int rowNum,
                        Table table)
                 throws DocumentException,
                        IOException
Write the RtfRow to the specified OutputStream.

Parameters:
os - The OutputStream to which this RtfRow should be written to.
rowNum - The index of this row in the containing table.
table - The Table which contains the original Row.
Throws:
DocumentException
IOException

writeBorder

private void writeBorder(ByteArrayOutputStream os,
                         byte[] borderType)
                  throws IOException
Throws:
IOException

setMerge

public void setMerge(int x,
                     int mergeType,
                     RtfCell mergeCell)
RtfTables call this method from their own setMerge() to specify that a certain other cell is to be merged with it.

Parameters:
x - The column position of the cell to be merged
mergeType - The merge type specifies the kind of merge to be applied (MERGE_HORIZ_PREV, MERGE_VERT_PREV, MERGE_BOTH_PREV)
mergeCell - The RtfCell that the cell at x and y is to be merged with

writeInt

private void writeInt(ByteArrayOutputStream out,
                      int i)
               throws IOException
Throws:
IOException