aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorWilliam Victor Mote <vmote@apache.org>2003-08-26 19:51:20 +0000
committerWilliam Victor Mote <vmote@apache.org>2003-08-26 19:51:20 +0000
commit3a3765cc5bf1972db666c136021579bdb9038406 (patch)
tree44970ba4b82d468b8a815e119d967e0029d231db /src/java/org
parent0fad1c60e96988add49177b62ee26a3ccf27a2d6 (diff)
downloadxmlgraphics-fop-3a3765cc5bf1972db666c136021579bdb9038406.tar.gz
xmlgraphics-fop-3a3765cc5bf1972db666c136021579bdb9038406.zip
1. make fo/flow/Table.columns store fo columns instead of column layout managers
2. move fo/flow/TableColumn.getLayoutManager() to layoutmgr/AddLMVisitor.getTableColumnLayoutManager() 3. have layoutmgr/AddLMVisitor.serveVisitor(Table node) loop through the fo/flow/Table.columns collection and build its layout manager collection from it git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196849 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/fo/flow/Table.java2
-rw-r--r--src/java/org/apache/fop/fo/flow/TableColumn.java13
-rw-r--r--src/java/org/apache/fop/layoutmgr/AddLMVisitor.java17
3 files changed, 18 insertions, 14 deletions
diff --git a/src/java/org/apache/fop/fo/flow/Table.java b/src/java/org/apache/fop/fo/flow/Table.java
index 12be61d95..feec07d25 100644
--- a/src/java/org/apache/fop/fo/flow/Table.java
+++ b/src/java/org/apache/fop/fo/flow/Table.java
@@ -115,7 +115,7 @@ public class Table extends FObj {
if (columns == null) {
columns = new ArrayList();
}
- columns.add(((TableColumn)child).getLayoutManager());
+ columns.add(((TableColumn)child));
} else if (child.getName().equals("fo:table-footer")) {
tableFooter = (TableBody)child;
} else if (child.getName().equals("fo:table-header")) {
diff --git a/src/java/org/apache/fop/fo/flow/TableColumn.java b/src/java/org/apache/fop/fo/flow/TableColumn.java
index b7bd579bd..d8bd8c742 100644
--- a/src/java/org/apache/fop/fo/flow/TableColumn.java
+++ b/src/java/org/apache/fop/fo/flow/TableColumn.java
@@ -60,9 +60,6 @@ import org.apache.fop.fo.Property;
import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.layoutmgr.LayoutManager;
-import org.apache.fop.layoutmgr.table.Column;
-import org.apache.fop.apps.*;
/**
* Class modelling the fo:table-column object. See Sec. 6.7.4 of the XSL-FO
@@ -87,14 +84,6 @@ public class TableColumn extends FObj {
super(parent);
}
- public LayoutManager getLayoutManager() {
- doSetup();
- Column clm = new Column();
- clm.setUserAgent(getUserAgent());
- clm.setFObj(this);
- return clm;
- }
-
/**
* @return Length object containing column width
*/
@@ -132,7 +121,7 @@ public class TableColumn extends FObj {
return numColumnsRepeated;
}
- private void doSetup() {
+ public void doSetup() {
// Common Border, Padding, and Background Properties
// only background apply, border apply if border-collapse
diff --git a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
index 1a54440a7..b718f720a 100644
--- a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
+++ b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java
@@ -95,6 +95,7 @@ import org.apache.fop.fo.flow.PageNumberCitation;
import org.apache.fop.fo.flow.Table;
import org.apache.fop.fo.flow.TableBody;
import org.apache.fop.fo.flow.TableCell;
+import org.apache.fop.fo.flow.TableColumn;
import org.apache.fop.fo.flow.TableRow;
import org.apache.fop.fo.pagination.Flow;
@@ -108,6 +109,7 @@ import org.apache.fop.layoutmgr.BidiLayoutManager;
import org.apache.fop.layoutmgr.LayoutProcessor;
import org.apache.fop.layoutmgr.LMiter;
import org.apache.fop.layoutmgr.table.Cell;
+import org.apache.fop.layoutmgr.table.Column;
import org.apache.fop.layoutmgr.table.Body;
import org.apache.fop.layoutmgr.table.Row;
import org.apache.fop.layoutmgr.table.TableLayoutManager;
@@ -782,7 +784,12 @@ public class AddLMVisitor extends FOTreeVisitor {
TableLayoutManager tlm = new TableLayoutManager();
tlm.setUserAgent(node.getUserAgent());
tlm.setFObj(node);
- tlm.setColumns(node.getColumns());
+ ArrayList columnLMs = new ArrayList();
+ ListIterator iter = node.getColumns().listIterator();
+ while (iter.hasNext()) {
+ columnLMs.add(getTableColumnLayoutManager((TableColumn)iter.next()));
+ }
+ tlm.setColumns(columnLMs);
if (node.getTableHeader() != null) {
tlm.setTableHeader(getTableBodyLayoutManager(node.getTableHeader()));
}
@@ -792,6 +799,14 @@ public class AddLMVisitor extends FOTreeVisitor {
currentLMList.add(tlm);
}
+ public LayoutManager getTableColumnLayoutManager(TableColumn node) {
+ node.doSetup();
+ Column clm = new Column();
+ clm.setUserAgent(node.getUserAgent());
+ clm.setFObj(node);
+ return clm;
+ }
+
public void serveVisitor(TableBody node) {
currentLMList.add(getTableBodyLayoutManager(node));
}