vmote 2003/08/26 12:51:20 Modified: src/java/org/apache/fop/fo/flow Table.java TableColumn.java src/java/org/apache/fop/layoutmgr AddLMVisitor.java Log: 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 Revision Changes Path 1.6 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/Table.java Index: Table.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Table.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- Table.java 22 Aug 2003 06:27:34 -0000 1.5 +++ Table.java 26 Aug 2003 19:51:20 -0000 1.6 @@ -115,7 +115,7 @@ 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")) { 1.7 +1 -12 xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java Index: TableColumn.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableColumn.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- TableColumn.java 22 Aug 2003 17:42:41 -0000 1.6 +++ TableColumn.java 26 Aug 2003 19:51:20 -0000 1.7 @@ -60,9 +60,6 @@ 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 @@ 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 @@ return numColumnsRepeated; } - private void doSetup() { + public void doSetup() { // Common Border, Padding, and Background Properties // only background apply, border apply if border-collapse 1.13 +17 -2 xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java Index: AddLMVisitor.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- AddLMVisitor.java 26 Aug 2003 16:48:28 -0000 1.12 +++ AddLMVisitor.java 26 Aug 2003 19:51:20 -0000 1.13 @@ -95,6 +95,7 @@ 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.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 @@ 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())); } @@ -790,6 +797,14 @@ tlm.setTableFooter(getTableBodyLayoutManager(node.getTableFooter())); } 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) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]