Package org.apache.fop.layoutmgr.table
Class CollapsingBorderModel
java.lang.Object
org.apache.fop.layoutmgr.table.CollapsingBorderModel
- Direct Known Subclasses:
CollapsingBorderModelEyeCatching
This class is a superclass for the two collapsing border models defined
in the XSL 1.0 specification.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final int
after sideprotected static final int
before sideprivate static CollapsingBorderModel
Indicates that the cell is/end in the last row of a body/table-header/table-footerprotected static final int
end sideprotected static final int
start side -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static int
compareFOs
(int id1, int id2) Compares the two given FO ids (Constants
.FO*) in terms of border declaration.private static int
compareInt
(int value1, int value2) (package private) static int
compareStyles
(int style1, int style2) Compares the two given styles (seeConstants
).abstract BorderSpecification
determineWinner
(BorderSpecification border1, BorderSpecification border2) Returns the border which wins the border conflict resolution.abstract BorderSpecification
determineWinner
(BorderSpecification border1, BorderSpecification border2, boolean discard) Returns the border which wins the border conflict resolution.static CollapsingBorderModel
getBorderModelFor
(int borderCollapse) private static int
getHolderPreferenceValue
(int id) static int
getOtherSide
(int side) private static int
getStylePreferenceValue
(int style) See rule 4 in 6.7.10 for the collapsing border model.protected boolean
isVerticalRelation
(int side)
-
Field Details
-
BEFORE
protected static final int BEFOREbefore side- See Also:
-
AFTER
protected static final int AFTERafter side- See Also:
-
START
protected static final int STARTstart side- See Also:
-
END
protected static final int ENDend side- See Also:
-
collapse
Indicates that the cell is/end in the last row of a body/table-header/table-footer
-
-
Constructor Details
-
CollapsingBorderModel
public CollapsingBorderModel()
-
-
Method Details
-
getBorderModelFor
- Parameters:
borderCollapse
- border collapse control- Returns:
- the border model for the cell
-
getOtherSide
public static int getOtherSide(int side) - Parameters:
side
- the side on the current cell- Returns:
- the adjacent side on the neighbouring cell
-
isVerticalRelation
protected boolean isVerticalRelation(int side) - Parameters:
side
- the side to investigate- Returns:
- true if the adjacent cell is before or after
-
compareInt
private static int compareInt(int value1, int value2) -
getStylePreferenceValue
private static int getStylePreferenceValue(int style) See rule 4 in 6.7.10 for the collapsing border model.- Parameters:
style
- the border style to get the preference value for- Returns:
- the preference value of the style
-
compareStyles
static int compareStyles(int style1, int style2) Compares the two given styles (seeConstants
).- Parameters:
style1
- a style constantstyle2
- another style constant- Returns:
- a value < 0 if style1 has less priority than style2, 0 if both are equal, a value > 0 if style1 has more priority than style2
-
getHolderPreferenceValue
private static int getHolderPreferenceValue(int id) -
compareFOs
static int compareFOs(int id1, int id2) Compares the two given FO ids (Constants
.FO*) in terms of border declaration.- Parameters:
id1
- a FO id (Constants.FO_TABLE
,Constants.FO_TABLE_BODY
, etc.)id2
- another FO id- Returns:
- a value < 0 if id1 has less priority than id2, 0 if both are equal, a value > 0 if id1 has more priority than id2
-
determineWinner
public abstract BorderSpecification determineWinner(BorderSpecification border1, BorderSpecification border2, boolean discard) Returns the border which wins the border conflict resolution. In case the two borders are equivalent (identical, or only the color is different), null is returned.- Parameters:
border1
- a border specificationborder2
- another border specificationdiscard
- true if the .conditionality component of the border width must be taken into account- Returns:
- the winning border, null if the two borders are equivalent
-
determineWinner
public abstract BorderSpecification determineWinner(BorderSpecification border1, BorderSpecification border2) Returns the border which wins the border conflict resolution. Same asdetermineWinner(border1, border2, false)
.- Parameters:
border1
- a border specificationborder2
- another border specification- Returns:
- the winning border, null if the two borders are equivalent
- See Also:
-