diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2008-05-12 19:37:39 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2008-05-12 19:37:39 +0000 |
commit | fd57079cbeda429803cff6cf2b8142146f5fef45 (patch) | |
tree | 3117e8768667df3555b1a2715ab45e9bf653ae54 /src/java/org/apache/fop/fo/flow/table/TableFObj.java | |
parent | b5179656de4cddd63571053d26e4161c8af14725 (diff) | |
download | xmlgraphics-fop-fd57079cbeda429803cff6cf2b8142146f5fef45.tar.gz xmlgraphics-fop-fd57079cbeda429803cff6cf2b8142146f5fef45.zip |
Put the resolutions of collapsed borders together into the CollapsingBorderResolver class.
The previous scheme allowed for early resolution of borders where possible, but made it hard to understand since the resolution was spread in the various table classes. Now everything is done inside a single class
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@655614 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/table/TableFObj.java')
-rw-r--r-- | src/java/org/apache/fop/fo/flow/table/TableFObj.java | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/src/java/org/apache/fop/fo/flow/table/TableFObj.java b/src/java/org/apache/fop/fo/flow/table/TableFObj.java index adeb2eadd..6bc113fd0 100644 --- a/src/java/org/apache/fop/fo/flow/table/TableFObj.java +++ b/src/java/org/apache/fop/fo/flow/table/TableFObj.java @@ -226,7 +226,12 @@ public abstract class TableFObj extends FObj { * Prepares the borders of this element if the collapsing-border model is in use. * Conflict resolution with parent elements is done where applicable. */ - protected abstract void setCollapsedBorders(); + protected void setCollapsedBorders() { + createBorder(CommonBorderPaddingBackground.START); + createBorder(CommonBorderPaddingBackground.END); + createBorder(CommonBorderPaddingBackground.BEFORE); + createBorder(CommonBorderPaddingBackground.AFTER); + } /** * Creates a BorderSpecification from the border set on the given side. If no border @@ -234,7 +239,7 @@ public abstract class TableFObj extends FObj { * * @param side one of CommonBorderPaddingBackground.BEFORE|AFTER|START|END */ - protected void createBorder(int side) { + private void createBorder(int side) { BorderSpecification borderSpec = new BorderSpecification( getCommonBorderPaddingBackground().getBorderInfo(side), getNameId()); switch (side) { @@ -253,33 +258,4 @@ public abstract class TableFObj extends FObj { default: assert false; } } - - /** - * Creates a BorderSpecification from the border set on the given side, performing - * conflict resolution with the same border on the given object. - * - * @param side one of CommonBorderPaddingBackground.BEFORE|AFTER|START|END - * @param competitor a parent table element whose side coincides with the given side - * on this element - */ - protected void createBorder(int side, TableFObj competitor) { - createBorder(side); - switch (side) { - case CommonBorderPaddingBackground.BEFORE: - borderBefore.integrateSegment(competitor.borderBefore, true, true, true); - break; - case CommonBorderPaddingBackground.AFTER: - borderAfter.integrateSegment(competitor.borderAfter, true, true, true); - break; - case CommonBorderPaddingBackground.START: - borderStart = collapsingBorderModel.determineWinner(borderStart, - competitor.borderStart); - break; - case CommonBorderPaddingBackground.END: - borderEnd = collapsingBorderModel.determineWinner(borderEnd, - competitor.borderEnd); - break; - default: assert false; - } - } } |