org.apache.fop.layoutmgr.table

Class PrimaryGridUnit


public class PrimaryGridUnit
extends GridUnit

This class represents a primary grid unit of a spanned cell. This is the "before-start" (top-left, usually) grid unit of the span.

Field Summary

Fields inherited from class org.apache.fop.layoutmgr.table.GridUnit

FIRST_IN_PART, FIRST_IN_TABLE, IN_FIRST_COLUMN, IN_LAST_COLUMN, KEEP_WITH_NEXT_PENDING, KEEP_WITH_PREVIOUS_PENDING, LAST_IN_PART, LAST_IN_TABLE

Constructor Summary

PrimaryGridUnit(TableCell cell, TableColumn column, int startCol, int startRow)
Creates a new primary grid unit.

Method Summary

void
addRow(GridUnit[] row)
TableCellLayoutManager
getCellLM()
int
getContentLength()
LinkedList
getElements()
int
getHalfMaxAfterBorderWidth()
int
getHalfMaxBeforeBorderWidth()
int
getHalfMaxBorderWidth()
List
getRows()
Returns the grid units belonging to the same span as this one.
int[]
getStartEndBorderWidths()
Returns the widths of the start- and end-borders of the span this grid unit belongs to.
int
getStartRow()
Returns the index of the row this grid unit belongs to.
boolean
hasBPD()
boolean
hasSpanning()
boolean
isPrimary()
void
setContentLength(int value)
void
setElements(LinkedList elements)
Sets the Knuth elements for the table cell containing this grid unit.
String
toString()

Methods inherited from class org.apache.fop.layoutmgr.table.GridUnit

assignBorderForSeparateBorderModel, createNextRowSpanningGridUnit, getBody, getBorders, getCell, getColSpanIndex, getColumn, getFlag, getOriginalBorderInfoForCell, getPrimary, getRow, getRowSpanIndex, getStartCol, getTable, hasBorders, isEmpty, isLastGridUnitColSpan, isLastGridUnitRowSpan, isPrimary, resolveBorder, resolveBorder, setFlag, setRow, toString

Constructor Details

PrimaryGridUnit

public PrimaryGridUnit(TableCell cell,
                       TableColumn column,
                       int startCol,
                       int startRow)
Creates a new primary grid unit.
Parameters:
cell - table cell which occupies this grid unit
column - table column this grid unit belongs to
startCol - index of the column this grid unit belongs to, zero-based
startRow - index of the row this grid unit belongs to, zero-based

Method Details

addRow

public void addRow(GridUnit[] row)

getCellLM

public TableCellLayoutManager getCellLM()

getContentLength

public int getContentLength()
Returns:
the length of the cell content.

getElements

public LinkedList getElements()

getHalfMaxAfterBorderWidth

public int getHalfMaxAfterBorderWidth()
Returns:
half the maximum after border width of this cell.

getHalfMaxBeforeBorderWidth

public int getHalfMaxBeforeBorderWidth()
Returns:
half the maximum before border width of this cell.

getHalfMaxBorderWidth

public int getHalfMaxBorderWidth()
Returns:
the sum of half the maximum before and after border widths of this cell.

getRows

public List getRows()
Returns the grid units belonging to the same span as this one.
Returns:
a list of GridUnit[], each array corresponds to a row

getStartEndBorderWidths

public int[] getStartEndBorderWidths()
Returns the widths of the start- and end-borders of the span this grid unit belongs to.
Returns:
a two-element array containing the widths of the start-border then the end-border

getStartRow

public int getStartRow()
Returns the index of the row this grid unit belongs to.
Returns:
the index of the row this grid unit belongs to.

hasBPD

public boolean hasBPD()
Returns:
true if cell/row has an explicit BPD/height

hasSpanning

public boolean hasSpanning()
Returns:
true if this cell spans over more than one grid unit.

isPrimary

public boolean isPrimary()
Overrides:
isPrimary in interface GridUnit

setContentLength

public void setContentLength(int value)
Parameters:
value - The length of the cell content to remember.

setElements

public void setElements(LinkedList elements)
Sets the Knuth elements for the table cell containing this grid unit.
Parameters:
elements - a list of ListElement (?)

toString

public String toString()
Overrides:
toString in interface GridUnit
See Also:
java.lang.Object.toString()

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