org.apache.fop.render.rtf.rtflib.tools

Class TableContext

Implemented Interfaces:
ITableColumnsInfo

public class TableContext
extends java.lang.Object
implements ITableColumnsInfo

Used when handling fo:table to hold information to build the table. Contributor(s):
Authors:
Bertrand Delacretaz
Trembicki-Guy, Ed
Boris Poud??rous
Peter Herweg This class was originally developed for the JFOR project and is now integrated into FOP.

Fields inherited from interface org.apache.fop.render.rtf.rtflib.rtfdoc.ITableColumnsInfo

INVALID_COLUMN_WIDTH

Constructor Summary

TableContext(BuilderContext ctx)

Method Summary

void
decreaseRowSpannings()
Added by Peter Herweg on 2002-06-29 This function is called after each finished table-row.
int
getColumnIndex()
RtfAttributes
getColumnRowSpanningAttrs()
Integer
getColumnRowSpanningNumber()
float
getColumnWidth()
Get current column width according to column iteration index
boolean
getFirstSpanningCol()
boolean
getNextRowBelongsToHeader()
int
getNumberOfColumns()
void
selectFirstColumn()
Reset the column iteration index, meant to be called when creating a new row The 'public' modifier has been added by Boris Poud??rous for 'number-columns-spanned' processing
void
selectNextColumn()
Increment the column iteration index The 'public' modifier has been added by Boris Poud??rous for 'number-columns-spanned' processing
void
setColumnIndex(int index)
Set current column index.
void
setCurrentColumnRowSpanning(Integer iRowSpanning, RtfAttributes attrs)
void
setCurrentFirstSpanningCol(boolean bFirstSpanningCol)
void
setNextColumnRowSpanning(Integer iRowSpanning, RtfAttributes attrs)
void
setNextColumnWidth(Float width)
Adds a column and sets its width.
void
setNextFirstSpanningCol(boolean bFirstSpanningCol)
void
setNextRowBelongsToHeader(boolean value)

Constructor Details

TableContext

public TableContext(BuilderContext ctx)
Parameters:
ctx - BuilderContext

Method Details

decreaseRowSpannings

public void decreaseRowSpannings()
Added by Peter Herweg on 2002-06-29 This function is called after each finished table-row. It decreases all values in colRowSpanningNumber by 1. If a value reaches 0 row-spanning is finished, and the value won't be decreased anymore.

getColumnIndex

public int getColumnIndex()
Specified by:
getColumnIndex in interface ITableColumnsInfo
Returns:
Index of current column

getColumnRowSpanningAttrs

public RtfAttributes getColumnRowSpanningAttrs()
Returns:
RtfAttributes of current row-spanning cell

getColumnRowSpanningNumber

public Integer getColumnRowSpanningNumber()
Returns:
Number of currently spanned rows

getColumnWidth

public float getColumnWidth()
Get current column width according to column iteration index
Specified by:
getColumnWidth in interface ITableColumnsInfo
Returns:
INVALID_COLUMN_WIDTH if we cannot find the value The 'public' modifier has been added by Boris Poud??rous for 'number-columns-spanned' processing

getFirstSpanningCol

public boolean getFirstSpanningCol()
Specified by:
getFirstSpanningCol in interface ITableColumnsInfo
Returns:
true, if it's the first of multiple spanning columns

getNextRowBelongsToHeader

public boolean getNextRowBelongsToHeader()
Returns:
true, if next row belongs to header

getNumberOfColumns

public int getNumberOfColumns()
Specified by:
getNumberOfColumns in interface ITableColumnsInfo
Returns:
Number of columns

selectFirstColumn

public void selectFirstColumn()
Reset the column iteration index, meant to be called when creating a new row The 'public' modifier has been added by Boris Poud??rous for 'number-columns-spanned' processing
Specified by:
selectFirstColumn in interface ITableColumnsInfo

selectNextColumn

public void selectNextColumn()
Increment the column iteration index The 'public' modifier has been added by Boris Poud??rous for 'number-columns-spanned' processing
Specified by:
selectNextColumn in interface ITableColumnsInfo

setColumnIndex

public void setColumnIndex(int index)
Set current column index.
Parameters:
index - New column index

setCurrentColumnRowSpanning

public void setCurrentColumnRowSpanning(Integer iRowSpanning,
                                        RtfAttributes attrs)
Parameters:
iRowSpanning - number of rows to span
attrs - RtfAttributes of row-spanning cell

setCurrentFirstSpanningCol

public void setCurrentFirstSpanningCol(boolean bFirstSpanningCol)
Parameters:
bFirstSpanningCol - specifies, if it's the first of multiple spanned columns

setNextColumnRowSpanning

public void setNextColumnRowSpanning(Integer iRowSpanning,
                                     RtfAttributes attrs)
Parameters:
iRowSpanning - number of rows to span in next column
attrs - RtfAttributes of row-spanning cell

setNextColumnWidth

public void setNextColumnWidth(Float width)
Adds a column and sets its width.
Parameters:
width - Width of next column

setNextFirstSpanningCol

public void setNextFirstSpanningCol(boolean bFirstSpanningCol)
Parameters:
bFirstSpanningCol - specifies, if it's the first of multiple spanned columns

setNextRowBelongsToHeader

public void setNextRowBelongsToHeader(boolean value)
Parameters:
value - Specifies, if next row belongs to header

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.