Package org.apache.fop.layoutmgr.table
Class ColumnSetup
- java.lang.Object
-
- org.apache.fop.layoutmgr.table.ColumnSetup
-
public class ColumnSetup extends java.lang.ObjectClass holding a number of columns making up the column setup of a row.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Listcolumnsprivate java.util.ListcolWidthsprivate static org.apache.commons.logging.LoglogLoggerprivate intmaxColIndexReferencedprivate Tabletableprivate WritingModeTraitsGetterwmTraits
-
Constructor Summary
Constructors Constructor Description ColumnSetup(Table table)Main Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatcomputeTableUnit(PercentBaseContext percentBaseContext, int contentAreaIPD)Works out the base unit for resolving proportional-column-width() [p-c-w(x) = x * base_unit_ipd]protected doublecomputeTableUnit(TableLayoutManager tlm)Works out the base unit for resolving proportional-column-width() [p-c-w(x) = x * base_unit_ipd]TableColumngetColumn(int index)Returns a column.intgetColumnCount()intgetSumOfColumnWidths(PercentBaseContext context)Calculates the sum of all column widths.intgetXOffset(int col, int nrColSpan, PercentBaseContext context)Determine the X offset of the indicated column, where this offset denotes the left edge of the column irrespective of writing mode.private intgetXOffsetLTR(int col, PercentBaseContext context)private intgetXOffsetRTL(int col, int nrColSpan, PercentBaseContext context)private voidinitializeColumnWidths()Initializes the column's widthsjava.util.Iteratoriterator()private voidprepareColumns()java.lang.StringtoString()
-
-
-
Field Detail
-
log
private static org.apache.commons.logging.Log log
Logger
-
table
private Table table
-
wmTraits
private WritingModeTraitsGetter wmTraits
-
columns
private java.util.List columns
-
colWidths
private java.util.List colWidths
-
maxColIndexReferenced
private int maxColIndexReferenced
-
-
Constructor Detail
-
ColumnSetup
public ColumnSetup(Table table)
Main Constructor.- Parameters:
table- the table to construct this column setup for
-
-
Method Detail
-
prepareColumns
private void prepareColumns()
-
getColumn
public TableColumn getColumn(int index)
Returns a column. If the index of the column is bigger than the number of explicitly defined columns the last column is returned.- Parameters:
index- index of the column (1 is the first column)- Returns:
- the requested column
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getColumnCount
public int getColumnCount()
- Returns:
- the number of columns in the setup.
-
iterator
public java.util.Iterator iterator()
- Returns:
- an Iterator over all columns
-
initializeColumnWidths
private void initializeColumnWidths()
Initializes the column's widths
-
computeTableUnit
protected double computeTableUnit(TableLayoutManager tlm)
Works out the base unit for resolving proportional-column-width() [p-c-w(x) = x * base_unit_ipd]- Parameters:
tlm- the TableLayoutManager- Returns:
- the computed base unit (in millipoint)
-
computeTableUnit
public float computeTableUnit(PercentBaseContext percentBaseContext, int contentAreaIPD)
Works out the base unit for resolving proportional-column-width() [p-c-w(x) = x * base_unit_ipd]- Parameters:
percentBaseContext- the percent base context for relative valuescontentAreaIPD- the IPD of the available content area- Returns:
- the computed base unit (in millipoints)
-
getXOffset
public int getXOffset(int col, int nrColSpan, PercentBaseContext context)Determine the X offset of the indicated column, where this offset denotes the left edge of the column irrespective of writing mode. If writing mode's column progression direction is right-to-left, then the first column is the right-most column and the last column is the left-most column; otherwise, the first column is the left-most column.- Parameters:
col- column index (1 is first column)nrColSpan- number columns spanned (for calculating offset in rtl mode)context- the context for percentage based calculations- Returns:
- the X offset of the requested column
-
getXOffsetRTL
private int getXOffsetRTL(int col, int nrColSpan, PercentBaseContext context)
-
getXOffsetLTR
private int getXOffsetLTR(int col, PercentBaseContext context)
-
getSumOfColumnWidths
public int getSumOfColumnWidths(PercentBaseContext context)
Calculates the sum of all column widths.- Parameters:
context- the context for percentage based calculations- Returns:
- the requested sum in millipoints
-
-