This class represents one grid unit inside a table.
FIRST_IN_PART
public static final int FIRST_IN_PART
Indicates that the grid unit is in the first row of the table part (header, footer, body).
FIRST_IN_TABLE
public static final int FIRST_IN_TABLE
Indicates that the grid unit is in the first row of the table.
IN_FIRST_COLUMN
public static final int IN_FIRST_COLUMN
Indicates that the grid unit is in the first column.
IN_LAST_COLUMN
public static final int IN_LAST_COLUMN
Indicates that the grid unit is in the last column.
KEEP_WITH_NEXT_PENDING
public static final int KEEP_WITH_NEXT_PENDING
Indicates that the primary grid unit has a pending keep-with-next.
KEEP_WITH_PREVIOUS_PENDING
public static final int KEEP_WITH_PREVIOUS_PENDING
Indicates that the primary grid unit has a pending keep-with-previous.
LAST_IN_PART
public static final int LAST_IN_PART
Indicates that the grid unit is in the last row of the table part (header, footer, body).
LAST_IN_TABLE
public static final int LAST_IN_TABLE
Indicates that the grid unit is in the last row of the table.
GridUnit
public GridUnit(TableCell cell,
TableColumn column,
int startCol,
int colSpanIndex)
Creates a new grid unit.
cell
- table cell which occupies this grid unitcolumn
- table column this grid unit belongs tostartCol
- index of the column this grid unit belongs tocolSpanIndex
- index of this grid unit in the span, in column direction
GridUnit
protected GridUnit(PrimaryGridUnit primary,
TableCell cell,
TableColumn column,
int startCol,
int colSpanIndex)
Creates a new grid unit.
primary
- the before-start grid unit of the cell containing this grid unitcell
- table cell which occupies this grid unitcolumn
- table column this grid unit belongs tostartCol
- index of the column this grid unit belongs tocolSpanIndex
- index of this grid unit in the span, in column direction
GridUnit
public GridUnit(PrimaryGridUnit primary,
TableColumn column,
int startCol,
int colSpanIndex)
Creates a new grid unit.
primary
- the before-start grid unit of the cell containing this grid unitcolumn
- table column this grid unit belongs tostartCol
- index of the column this grid unit belongs tocolSpanIndex
- index of this grid unit in the span, in column direction
assignBorderForSeparateBorderModel
public void assignBorderForSeparateBorderModel()
Assigns the borders from the given cell to this cell info. Used in
case of separate border model.
createNextRowSpanningGridUnit
public GridUnit createNextRowSpanningGridUnit()
- the grid unit just below this grid unit if the cell is spanning.
getColSpanIndex
public int getColSpanIndex()
- the index of the grid unit inside a cell in column direction
getFlag
public boolean getFlag(int which)
Returns a flag for this GridUnit.
which
- the requested flag
getOriginalBorderInfoForCell
public CommonBorderPaddingBackground.BorderInfo getOriginalBorderInfoForCell(int side)
Returns a BorderInfo instance for a side of the currently applicable cell before border
resolution (i.e. the value from the FO). A return value of null indicates an empty cell.
See CollapsingBorderModel(EyeCatching) where this method is used.
side
- for which side to return the BorderInfo
- the requested BorderInfo instance or null if the grid unit is an empty cell
getPrimary
public PrimaryGridUnit getPrimary()
Returns the before-start grid unit of the cell containing this grid unit.
- the before-start grid unit of the cell containing this grid unit.
getRowSpanIndex
public int getRowSpanIndex()
- the index of the grid unit inside a cell in row direction
getStartCol
public int getStartCol()
getTable
public Table getTable()
hasBorders
public boolean hasBorders()
- true if the grid unit has any borders.
isEmpty
public boolean isEmpty()
Does this grid unit belong to an empty cell?
- true if this grid unit belongs to an empty cell
isLastGridUnitColSpan
public boolean isLastGridUnitColSpan()
- true if the grid unit is the last in column spanning direction
isLastGridUnitRowSpan
public boolean isLastGridUnitRowSpan()
- true if the grid unit is the last in row spanning direction
isPrimary
public boolean isPrimary()
Is this grid unit the before-start grid unit of the cell?
- true if this grid unit is the before-start grid unit of the cell
resolveBorder
public void resolveBorder(GridUnit other,
int side)
Resolve collapsing borders for the given cell. Used in case of the collapsing border model.
other
- neighbouring grid unit if anyside
- the side to resolve (one of CommonBorderPaddingBackground.BEFORE|AFTER|START|END)
resolveBorder
public void resolveBorder(GridUnit other,
int side,
int resFlags)
Resolve collapsing borders for the given cell. Used in case of the collapsing border model.
other
- neighbouring grid unit if anyside
- the side to resolve (one of CommonBorderPaddingBackground.BEFORE|AFTER|START|END)resFlags
- flags for the border resolution
setFlag
public void setFlag(int which,
boolean value)
Sets a flag on a GridUnit.
which
- the flag to setvalue
- the new value for the flag
setRow
public void setRow(TableRow row)
Sets the table-row FO, if applicable.
toString
public String toString()
java.lang.Object.toString()