From 3a3765cc5bf1972db666c136021579bdb9038406 Mon Sep 17 00:00:00 2001 From: William Victor Mote Date: Tue, 26 Aug 2003 19:51:20 +0000 Subject: 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 --- src/java/org/apache/fop/fo/flow/Table.java | 2 +- src/java/org/apache/fop/fo/flow/TableColumn.java | 13 +------------ src/java/org/apache/fop/layoutmgr/AddLMVisitor.java | 17 ++++++++++++++++- 3 files changed, 18 insertions(+), 14 deletions(-) (limited to 'src/java/org') 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)); } -- cgit v1.2.3