Package org.apache.fop.fo.flow.table
Class ConditionalBorder
java.lang.Object
org.apache.fop.fo.flow.table.ConditionalBorder
A class that holds the three possible values for a border-before/after on a table-cell,
in the collapsing model. These three values are (for border-before, similar for
border-after):
- normal: common case, when a cell follows the cell before on a same page;
- leading: when the table is broken and the cell appears at the top of a page, in which case its border must be resolved with the header (or the top of the table) instead of with the previous cell;
- rest: when a cell is broken over several pages; same as leading but with conditionality taken into account.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CollapsingBorderModel
The model used to resolve borders.static final int
leading and trailing border(package private) BorderSpecification
Special case: the cell is at the top or the bottom of the page.(package private) BorderSpecification
Normal case, no break.static final int
normal border(package private) BorderSpecification
Special case: break inside the cell.static final int
all the rest -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ConditionalBorder
(BorderSpecification normal, BorderSpecification leadingTrailing, BorderSpecification rest, CollapsingBorderModel collapsingBorderModel) (package private)
ConditionalBorder
(BorderSpecification borderSpecification, CollapsingBorderModel collapsingBorderModel) Creates a new conditional border. -
Method Summary
Modifier and TypeMethodDescription(package private) ConditionalBorder
copy()
Returns a shallow copy of this border.(package private) static ConditionalBorder
getDefaultBorder
(CollapsingBorderModel collapsingBorderModel) Returns a default border specification.(package private) void
integrateCompetingSegment
(ConditionalBorder competitor, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Integrates the given segment in this border.(package private) void
integrateSegment
(ConditionalBorder segment, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Updates this border after taking into account the given segment.(package private) void
resolve
(ConditionalBorder competitor, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Resolves and updates the relevant parts of this border as well as the given one.toString()
-
Field Details
-
NORMAL
public static final int NORMALnormal border- See Also:
-
LEADING_TRAILING
public static final int LEADING_TRAILINGleading and trailing border- See Also:
-
REST
public static final int RESTall the rest- See Also:
-
normal
BorderSpecification normalNormal case, no break. -
leadingTrailing
BorderSpecification leadingTrailingSpecial case: the cell is at the top or the bottom of the page. -
rest
BorderSpecification restSpecial case: break inside the cell. -
collapsingBorderModel
The model used to resolve borders.
-
-
Constructor Details
-
ConditionalBorder
private ConditionalBorder(BorderSpecification normal, BorderSpecification leadingTrailing, BorderSpecification rest, CollapsingBorderModel collapsingBorderModel) -
ConditionalBorder
ConditionalBorder(BorderSpecification borderSpecification, CollapsingBorderModel collapsingBorderModel) Creates a new conditional border.- Parameters:
borderSpecification
- the border specification to take as a basiscollapsingBorderModel
- the model that will be used to resolved borders
-
-
Method Details
-
resolve
void resolve(ConditionalBorder competitor, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Resolves and updates the relevant parts of this border as well as the given one.- Parameters:
competitor
-withNormal
-withLeadingTrailing
-withRest
-
-
integrateCompetingSegment
void integrateCompetingSegment(ConditionalBorder competitor, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Integrates the given segment in this border. Unlike forintegrateSegment(ConditionalBorder, boolean, boolean, boolean)
, this method nicely handles the case where the CollapsingBorderModel returns null, by keeping the components to their old values.- Parameters:
competitor
-withNormal
-withLeadingTrailing
-withRest
-
-
integrateSegment
void integrateSegment(ConditionalBorder segment, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Updates this border after taking into account the given segment. The CollapsingBorderModel is not expected to return null.- Parameters:
segment
-withNormal
-withLeadingTrailing
-withRest
-
-
copy
ConditionalBorder copy()Returns a shallow copy of this border.- Returns:
- a copy of this border
-
toString
-
getDefaultBorder
Returns a default border specification.- Parameters:
collapsingBorderModel
- the model that will be used to resolve borders- Returns:
- a border with style 'none' for all of the three components
-