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 CollapsingBorderModelThe model used to resolve borders.static final intleading and trailing border(package private) BorderSpecificationSpecial case: the cell is at the top or the bottom of the page.(package private) BorderSpecificationNormal case, no break.static final intnormal border(package private) BorderSpecificationSpecial case: break inside the cell.static final intall the rest -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConditionalBorder(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) ConditionalBordercopy()Returns a shallow copy of this border.(package private) static ConditionalBordergetDefaultBorder(CollapsingBorderModel collapsingBorderModel) Returns a default border specification.(package private) voidintegrateCompetingSegment(ConditionalBorder competitor, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Integrates the given segment in this border.(package private) voidintegrateSegment(ConditionalBorder segment, boolean withNormal, boolean withLeadingTrailing, boolean withRest) Updates this border after taking into account the given segment.(package private) voidresolve(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
-