aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo/flow/Table.java
diff options
context:
space:
mode:
authorjtauber <jtauber@unknown>1999-11-25 17:33:16 +0000
committerjtauber <jtauber@unknown>1999-11-25 17:33:16 +0000
commit5273e66a656c4e769d0820fabc3dfbc9b35a6c50 (patch)
tree8c4b6a292f1ad503b961295492ffaf25b5ce83e8 /src/org/apache/fop/fo/flow/Table.java
parentfcc0954359c3dca5843a9c2ba24d3f0628fd717f (diff)
downloadxmlgraphics-fop-5273e66a656c4e769d0820fabc3dfbc9b35a6c50.tar.gz
xmlgraphics-fop-5273e66a656c4e769d0820fabc3dfbc9b35a6c50.zip
Partial implementation of keep-with-next (doesn't yet remove area from previous page when fo is moved to next page to ensure keep). The layout method on each FO now returns a Status object rather than an int to allow for more information to be passed back in the future.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193240 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo/flow/Table.java')
-rw-r--r--src/org/apache/fop/fo/flow/Table.java29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/org/apache/fop/fo/flow/Table.java b/src/org/apache/fop/fo/flow/Table.java
index a41c938e6..52263f756 100644
--- a/src/org/apache/fop/fo/flow/Table.java
+++ b/src/org/apache/fop/fo/flow/Table.java
@@ -48,6 +48,7 @@
Software Foundation, please see <http://www.apache.org/>.
*/
+
package org.apache.fop.fo.flow;
// FOP
@@ -90,9 +91,9 @@ public class Table extends FObj {
this.name = "fo:table";
}
- public int layout(Area area) throws FOPException {
+ public Status layout(Area area) throws FOPException {
if (this.marker == BREAK_AFTER) {
- return OK;
+ return new Status(Status.OK);
}
if (this.marker == START) {
@@ -130,15 +131,15 @@ public class Table extends FObj {
this.marker = 0;
if (breakBefore == BreakBefore.PAGE) {
- return FORCE_PAGE_BREAK;
+ return new Status(Status.FORCE_PAGE_BREAK);
}
if (breakBefore == BreakBefore.ODD_PAGE) {
- return FORCE_PAGE_BREAK_ODD;
+ return new Status(Status.FORCE_PAGE_BREAK_ODD);
}
if (breakBefore == BreakBefore.EVEN_PAGE) {
- return FORCE_PAGE_BREAK_EVEN;
+ return new Status(Status.FORCE_PAGE_BREAK_EVEN);
}
}
@@ -173,7 +174,7 @@ public class Table extends FObj {
} else if (fo instanceof TableBody) {
if (columns.size() == 0) {
System.err.println("WARNING: current implementation of tables requires a table-column for each column, indicating column-width");
- return OK;
+ return new Status(Status.OK);
}
//if (this.isInListBody) {
@@ -184,11 +185,11 @@ public class Table extends FObj {
((TableBody) fo).setColumns(columns);
- int status;
- if ((status = fo.layout(blockArea)) != OK) {
+ Status status;
+ if ((status = fo.layout(blockArea)).isIncomplete()) {
this.marker = i;
- if ((i != 0) && (status == AREA_FULL_NONE)) {
- status = AREA_FULL_SOME;
+ if ((i != 0) && (status.getCode() == Status.AREA_FULL_NONE)) {
+ status = new Status(Status.AREA_FULL_SOME);
}
//blockArea.end();
area.addChild(blockArea);
@@ -214,20 +215,20 @@ public class Table extends FObj {
if (breakAfter == BreakAfter.PAGE) {
this.marker = BREAK_AFTER;
- return FORCE_PAGE_BREAK;
+ return new Status(Status.FORCE_PAGE_BREAK);
}
if (breakAfter == BreakAfter.ODD_PAGE) {
this.marker = BREAK_AFTER;
- return FORCE_PAGE_BREAK_ODD;
+ return new Status(Status.FORCE_PAGE_BREAK_ODD);
}
if (breakAfter == BreakAfter.EVEN_PAGE) {
this.marker = BREAK_AFTER;
- return FORCE_PAGE_BREAK_EVEN;
+ return new Status(Status.FORCE_PAGE_BREAK_EVEN);
}
- return OK;
+ return new Status(Status.OK);
}
public int getAreaHeight() {