com.lowagie.text.rtf

Class RtfCell

public class RtfCell extends Object

Deprecated: Please move to the RtfWriter2 and associated classes.

A Helper Class for the RtfWriter.

Do not use it directly ONLY FOR USE WITH THE RtfWriter NOT with the RtfWriter2. Parts of this Class were contributed by Steffen Stundzig. Many thanks for the improvements. Updates by Benoit Wiart

Field Summary
static byte[]cellBackgroundColor
Cell background color
static byte[]cellBorderBottom
Cell border bottom
static byte[]cellBorderLeft
Cell border left
static byte[]cellBorderRight
Cell border right
static byte[]cellBorderTop
Cell border top
static byte[]cellEnd
End of cell
protected static byte[]cellInTable
Cell is part of table
static byte[]cellMergeFirst
First cell to merge with - Horizontal
static byte[]cellMergePrev
Merge cell with previous horizontal cell
intcellpadding
cell padding, because the table only renders the left and right cell padding and not the top and bottom one
static byte[]cellPaddingBottom
padding bottom
static byte[]cellPaddingBottomUnit
padding bottom unit
static byte[]cellPaddingLeft
padding left
static byte[]cellPaddingLeftUnit
padding left unit
static byte[]cellPaddingRight
padding right
static byte[]cellPaddingRightUnit
padding right unit
static byte[]cellPaddingTop
padding top
static byte[]cellPaddingTopUnit
padding top unit
intcellRight
Cell right border position
static byte[]cellRightBorder
Cell right border position
static byte[]cellVerticalAlignBottom
Cell content vertical alignment bottom
static byte[]cellVerticalAlignCenter
Cell content vertical alignment center
static byte[]cellVerticalAlignTop
Cell content vertical alignment top
static byte[]cellVMergeFirst
First cell to merge with - Vertical
static byte[]cellVMergePrev
Merge cell with previous vertical cell
intcellWidth
Cell width
static byte[]cellWidthStyle
Cell width format
static byte[]cellWidthTag
Cell width
booleanemptyCell
Is this an empty cell
RtfTablemainTable
The RtfTable to which this RtfCell belongs.
intmergeType
Type of merging to do
static intMERGE_BOTH_FIRST
A possible value for merging
static intMERGE_BOTH_PREV
A possible value for merging
static intMERGE_HORIZ_FIRST
A possible value for merging
static intMERGE_HORIZ_PREV
A possible value for merging
static intMERGE_VERT_FIRST
A possible value for merging
static intMERGE_VERT_PREV
A possible value for merging
Cellstore
Cell containing the actual data
RtfWriterwriter
The RtfWriter to which this RtfCell belongs.
Constructor Summary
RtfCell(RtfWriter writer, RtfTable mainTable)
Create a new RtfCell.
Method Summary
intgetCellRight()
Get the position of the right border of this RtfCell.
intgetCellWidth()
Get the with of this RtfCell
CellgetStore()
Get the Cell with the actual content.
intimportCell(Cell cell, int cellLeft, int cellWidth, int x, int y, int cellpadding)
Import a Cell.
voidsetCellRight(int value)
Sets the right position of the cell
voidsetCellWidth(int value)
sets the width of the cell
voidsetMerge(int mergeType, RtfCell mergeCell)
Sets the merge type and the RtfCell with which this RtfCell is to be merged.
booleanwriteCellContent(ByteArrayOutputStream os)
Write the content of the RtfCell.
booleanwriteCellSettings(ByteArrayOutputStream os)
Write the properties of the RtfCell.
voidwriteInt(ByteArrayOutputStream out, int i)
Write an Integer to the Outputstream.

Field Detail

cellBackgroundColor

private static final byte[] cellBackgroundColor
Cell background color

cellBorderBottom

private static final byte[] cellBorderBottom
Cell border bottom

cellBorderLeft

private static final byte[] cellBorderLeft
Cell border left

cellBorderRight

private static final byte[] cellBorderRight
Cell border right

cellBorderTop

private static final byte[] cellBorderTop
Cell border top

cellEnd

private static final byte[] cellEnd
End of cell

cellInTable

protected static final byte[] cellInTable
Cell is part of table

cellMergeFirst

private static final byte[] cellMergeFirst
First cell to merge with - Horizontal

cellMergePrev

private static final byte[] cellMergePrev
Merge cell with previous horizontal cell

cellpadding

private int cellpadding
cell padding, because the table only renders the left and right cell padding and not the top and bottom one

cellPaddingBottom

private static final byte[] cellPaddingBottom
padding bottom

cellPaddingBottomUnit

private static final byte[] cellPaddingBottomUnit
padding bottom unit

cellPaddingLeft

private static final byte[] cellPaddingLeft
padding left

cellPaddingLeftUnit

private static final byte[] cellPaddingLeftUnit
padding left unit

cellPaddingRight

private static final byte[] cellPaddingRight
padding right

cellPaddingRightUnit

private static final byte[] cellPaddingRightUnit
padding right unit

cellPaddingTop

private static final byte[] cellPaddingTop
padding top

cellPaddingTopUnit

private static final byte[] cellPaddingTopUnit
padding top unit

cellRight

private int cellRight
Cell right border position

cellRightBorder

private static final byte[] cellRightBorder
Cell right border position

cellVerticalAlignBottom

private static final byte[] cellVerticalAlignBottom
Cell content vertical alignment bottom

cellVerticalAlignCenter

private static final byte[] cellVerticalAlignCenter
Cell content vertical alignment center

cellVerticalAlignTop

private static final byte[] cellVerticalAlignTop
Cell content vertical alignment top

cellVMergeFirst

private static final byte[] cellVMergeFirst
First cell to merge with - Vertical

cellVMergePrev

private static final byte[] cellVMergePrev
Merge cell with previous vertical cell

cellWidth

private int cellWidth
Cell width

cellWidthStyle

private static final byte[] cellWidthStyle
Cell width format

cellWidthTag

private static final byte[] cellWidthTag
Cell width

emptyCell

private boolean emptyCell
Is this an empty cell

mainTable

private RtfTable mainTable
The RtfTable to which this RtfCell belongs.

mergeType

private int mergeType
Type of merging to do

MERGE_BOTH_FIRST

private static final int MERGE_BOTH_FIRST
A possible value for merging

MERGE_BOTH_PREV

private static final int MERGE_BOTH_PREV
A possible value for merging

MERGE_HORIZ_FIRST

private static final int MERGE_HORIZ_FIRST
A possible value for merging

MERGE_HORIZ_PREV

private static final int MERGE_HORIZ_PREV
A possible value for merging

MERGE_VERT_FIRST

private static final int MERGE_VERT_FIRST
A possible value for merging

MERGE_VERT_PREV

private static final int MERGE_VERT_PREV
A possible value for merging

store

private Cell store
Cell containing the actual data

writer

private RtfWriter writer
The RtfWriter to which this RtfCell belongs.

Constructor Detail

RtfCell

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

Parameters: writer The RtfWriter that this RtfCell belongs to mainTable The RtfTable that created the RtfRow that created the RtfCell :-)

Method Detail

getCellRight

public int getCellRight()
Get the position of the right border of this RtfCell.

Returns: position of the right border

getCellWidth

public int getCellWidth()
Get the with of this RtfCell

Returns: Width of the current RtfCell

getStore

public Cell getStore()
Get the Cell with the actual content.

Returns: Cell which is contained in the RtfCell

importCell

public int importCell(Cell cell, int cellLeft, int cellWidth, int x, int y, int cellpadding)
Import a Cell.

Parameters: cell The Cell containing the data for this RtfCell cellLeft The position of the left border cellWidth The default width of a cell x The column index of this RtfCell y The row index of this RtfCell cellpadding the cellpadding

Returns: the position of the right side of the cell

setCellRight

public void setCellRight(int value)
Sets the right position of the cell

Parameters: value a cell position

setCellWidth

public void setCellWidth(int value)
sets the width of the cell

Parameters: value a width

setMerge

public void setMerge(int mergeType, RtfCell mergeCell)
Sets the merge type and the RtfCell with which this RtfCell is to be merged.

Parameters: 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

writeCellContent

public boolean writeCellContent(ByteArrayOutputStream os)
Write the content of the RtfCell.

Parameters: os The OutputStream to which to write the content of the RtfCell to.

Returns: true if writing the cell content succeeded

Throws: DocumentException

writeCellSettings

public boolean writeCellSettings(ByteArrayOutputStream os)
Write the properties of the RtfCell.

Parameters: os The OutputStream to which to write the properties of the RtfCell to.

Returns: true if writing the cell settings succeeded

Throws: DocumentException

writeInt

private void writeInt(ByteArrayOutputStream out, int i)
Write an Integer to the Outputstream.

Parameters: out The OutputStream to be written to. i The int to be written.

Throws: IOException