Package org.apache.fop.fo.flow.table
Class GridUnit
java.lang.Object
org.apache.fop.fo.flow.table.GridUnit
- Direct Known Subclasses:
EmptyGridUnit
,PrimaryGridUnit
This class represents one grid unit inside a table.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TableCell
Table cell which occupies this grid unitprotected CollapsingBorderModel
The border model helper associated with the tablestatic final int
Indicates that the grid unit is in the first row of the table part (header, footer, body).static final int
Indicates that the primary grid unit has a pending keep-with-next.static final int
Indicates that the primary grid unit has a pending keep-with-previous.static final int
Indicates that the grid unit is in the last row of the table part (header, footer, body). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBorderAfter
(int which) Returns the resolved border-after of this grid unit, in the collapsing-border model.getBorderBefore
(int which) Returns the resolved border-before of this grid unit, in the collapsing-border model.Returns the resolved border-end of this grid unit, in the collapsing-border model.Returns the resolved border-start of this grid unit, in the collapsing-border model.getCell()
Returns the table cell associated with this grid unit.int
boolean
getFlag
(int which) Returns a flag for this GridUnit.Returns the before-start grid unit of the cell containing this grid unit.getRow()
Returns the fo:table-row element (if any) this grid unit belongs to.int
boolean
isEmpty()
Does this grid unit belong to an empty cell?boolean
boolean
boolean
Is this grid unit the before-start grid unit of the cell?protected void
Prepares the borders of this grid unit for upcoming resolution, in the collapsing model.void
setFlag
(int which) Sets the given flag on this grid unit.void
setFlag
(int which, boolean value) Sets a flag on a GridUnit.toString()
-
Field Details
-
FIRST_IN_PART
public static final int FIRST_IN_PARTIndicates that the grid unit is in the first row of the table part (header, footer, body).- See Also:
-
LAST_IN_PART
public static final int LAST_IN_PARTIndicates that the grid unit is in the last row of the table part (header, footer, body).- See Also:
-
KEEP_WITH_NEXT_PENDING
public static final int KEEP_WITH_NEXT_PENDINGIndicates that the primary grid unit has a pending keep-with-next.- See Also:
-
KEEP_WITH_PREVIOUS_PENDING
public static final int KEEP_WITH_PREVIOUS_PENDINGIndicates that the primary grid unit has a pending keep-with-previous.- See Also:
-
cell
Table cell which occupies this grid unit -
collapsingBorderModel
The border model helper associated with the table
-
-
Constructor Details
-
GridUnit
Creates a new grid unit.- Parameters:
table
- the containing tablecolSpanIndex
- index of this grid unit in the span, in column directionrowSpanIndex
- index of this grid unit in the span, in row direction
-
GridUnit
Creates a new grid unit.- Parameters:
cell
- table cell which occupies this grid unitcolSpanIndex
- index of this grid unit in the span, in column directionrowSpanIndex
- index of this grid unit in the span, in row direction
-
-
Method Details
-
setBordersFromCell
protected void setBordersFromCell()Prepares the borders of this grid unit for upcoming resolution, in the collapsing model. -
getCell
Returns the table cell associated with this grid unit.- Returns:
- the table cell
-
getRow
Returns the fo:table-row element (if any) this grid unit belongs to.- Returns:
- the row containing this grid unit, or null if there is no fo:table-row element in the corresponding table-part
-
getPrimary
Returns the before-start grid unit of the cell containing this grid unit.- Returns:
- the before-start grid unit of the cell containing this grid unit.
-
isPrimary
public boolean isPrimary()Is this grid unit the before-start grid unit of the cell?- Returns:
- true if this grid unit is the before-start grid unit of the cell
-
isEmpty
public boolean isEmpty()Does this grid unit belong to an empty cell?- Returns:
- true if this grid unit belongs to an empty cell
-
isLastGridUnitColSpan
public boolean isLastGridUnitColSpan()- Returns:
- true if the grid unit is the last in column spanning direction
-
isLastGridUnitRowSpan
public boolean isLastGridUnitRowSpan()- Returns:
- true if the grid unit is the last in row spanning direction
-
getRowSpanIndex
public int getRowSpanIndex()- Returns:
- the index of the grid unit inside a cell in row direction
-
getColSpanIndex
public int getColSpanIndex()- Returns:
- the index of the grid unit inside a cell in column direction
-
getBorderBefore
Returns the resolved border-before of this grid unit, in the collapsing-border model.- Parameters:
which
- one ofConditionalBorder.NORMAL
,ConditionalBorder.LEADING_TRAILING
orConditionalBorder.REST
- Returns:
- the corresponding border
-
getBorderAfter
Returns the resolved border-after of this grid unit, in the collapsing-border model.- Parameters:
which
- one ofConditionalBorder.NORMAL
,ConditionalBorder.LEADING_TRAILING
orConditionalBorder.REST
- Returns:
- the corresponding border
-
getBorderStart
Returns the resolved border-start of this grid unit, in the collapsing-border model.- Returns:
- the corresponding border
-
getBorderEnd
Returns the resolved border-end of this grid unit, in the collapsing-border model.- Returns:
- the corresponding border
-
getFlag
public boolean getFlag(int which) Returns a flag for this GridUnit.- Parameters:
which
- the requested flag- Returns:
- the value of the flag
-
setFlag
public void setFlag(int which, boolean value) Sets a flag on a GridUnit.- Parameters:
which
- the flag to setvalue
- the new value for the flag
-
setFlag
public void setFlag(int which) Sets the given flag on this grid unit.- Parameters:
which
- the flag to set
-
toString
-