cvs commit: xml-fop/src/java/org/apache/fop/fo/flow Table.java
jeremias2005/02/09 03:47:42 Modified:src/java/org/apache/fop/fo/flow Table.java Log: Accessor for table-layout property. Revision ChangesPath 1.46 +5 -0 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.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- Table.java8 Feb 2005 09:20:41 - 1.45 +++ Table.java9 Feb 2005 11:47:42 - 1.46 @@ -146,6 +146,11 @@ } } +/** @return true of table-layout=auto */ +public boolean isAutoLayout() { +return (tableLayout != EN_FIXED); +} + public List getColumns() { return columns; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/table Row.java Cell.java
jeremias2005/02/09 03:51:30 Modified:src/java/org/apache/fop/layoutmgr/table Row.java Cell.java Log: Fix for handling of horizontal border-separation. My first interpretation was wrong. Revision ChangesPath 1.22 +2 -12 xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java Index: Row.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Row.java 8 Feb 2005 16:37:23 - 1.21 +++ Row.java 9 Feb 2005 11:51:30 - 1.22 @@ -229,16 +229,10 @@ //Determine which columns this cell will occupy getColumnsForCell(cellLM, startColumn, spannedColumns); int childRefIPD = 0; -Iterator i = spannedColumns.iterator(); -while (i.hasNext()) { -Column col = (Column)i.next(); +for (int i = 0; i spannedColumns.size(); i++) { +Column col = (Column)spannedColumns.get(i); childRefIPD += col.getWidth().getValue(); } -//Handle border-separation when border-collapse=separate -if (getTable().getBorderCollapse() == EN_SEPARATE) { -childRefIPD += (spannedColumns.size() - 1) -* getTable().getBorderSeparation().getIPD().getLength().getValue(); -} childLC.setRefIPD(childRefIPD); if (cellLM != null) { @@ -280,11 +274,7 @@ } //Adjust in-row x offset for individual cells -//TODO Probably needs more work to support writing modes ipdOffset += childRefIPD; -if (getTable().getBorderCollapse() == EN_SEPARATE) { -ipdOffset += getTable().getBorderSeparation().getIPD().getLength().getValue(); -} // the min is the maximum min of all cells 1.19 +24 -1 xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java Index: Cell.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- Cell.java 8 Feb 2005 17:41:23 - 1.18 +++ Cell.java 9 Feb 2005 11:51:30 - 1.19 @@ -18,6 +18,8 @@ package org.apache.fop.layoutmgr.table; +import org.apache.fop.fo.FONode; +import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableCell; import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; @@ -74,6 +76,17 @@ return this.fobj; } +/** + * @return the table owning this cell + */ +public Table getTable() { +FONode node = fobj.getParent(); +while (!(node instanceof Table)) { +node = node.getParent(); +} +return (Table)node; +} + private int getIPIndents() { int iIndents = 0; iIndents += fobj.getCommonBorderPaddingBackground().getIPPaddingAndBorder(false); @@ -102,6 +115,11 @@ referenceIPD = context.getRefIPD(); cellIPD = referenceIPD; cellIPD -= getIPIndents(); +if (getTable().getBorderCollapse() == EN_SEPARATE) { +int borderSep = getTable().getBorderSeparation().getLengthPair() +.getIPD().getLength().getValue(); +cellIPD -= borderSep; +} while ((curLM = getChildLM()) != null) { if (curLM.generatesInlineAreas()) { @@ -294,7 +312,12 @@ indent += fobj.getCommonBorderPaddingBackground().getBorderStartWidth(false); indent += fobj.getCommonBorderPaddingBackground().getPaddingStart(false); // set position -curBlockArea.setXOffset(xoffset + inRowIPDOffset + indent); +int halfBorderSep = 0; +if (getTable().getBorderCollapse() == EN_SEPARATE) { +halfBorderSep = getTable().getBorderSeparation().getLengthPair() +.getIPD().getLength().getValue() / 2; +} +curBlockArea.setXOffset(xoffset + inRowIPDOffset + halfBorderSep + indent); curBlockArea.setYOffset(yoffset); curBlockArea.setIPD(cellIPD); //curBlockArea.setHeight(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/test/layoutengine/testcases table-cell5a.xml
jeremias2005/02/09 03:53:16 Modified:test/layoutengine/testcases table-cell5a.xml Log: Corrected my interpretation of border-separation. Revision ChangesPath 1.2 +41 -40xml-fop/test/layoutengine/testcases/table-cell5a.xml Index: table-cell5a.xml === RCS file: /home/cvs/xml-fop/test/layoutengine/testcases/table-cell5a.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- table-cell5a.xml 9 Feb 2005 08:28:00 - 1.1 +++ table-cell5a.xml 9 Feb 2005 11:53:16 - 1.2 @@ -94,49 +94,50 @@ !-- cell 1 -- eval expected=24400 xpath=//flow/block[1]/block[1]/@bpda/ eval expected=24400 xpath=//flow/block[1]/block[1]/@bpd/ -eval expected=16 xpath=//flow/block[1]/block[1]/@ipda/ -eval expected=16 xpath=//flow/block[1]/block[1]/@ipd/ +eval expected=155000 xpath=//flow/block[1]/block[1]/@ipda/ +eval expected=155000 xpath=//flow/block[1]/block[1]/@ipd/ +eval expected=2500 xpath=//flow/block[1]/block[1]/@left-offset/ eval expected=14400 xpath=//flow/block[1]/block[1]/block[1]/@bpda/ eval expected=14400 xpath=//flow/block[1]/block[1]/block[1]/@bpd/ -eval expected=16 xpath=//flow/block[1]/block[1]/block[1]/@ipda/ -eval expected=16 xpath=//flow/block[1]/block[1]/block[1]/@ipd/ +eval expected=155000 xpath=//flow/block[1]/block[1]/block[1]/@ipda/ +eval expected=155000 xpath=//flow/block[1]/block[1]/block[1]/@ipd/ !-- cell 2 -- eval expected=24400 xpath=//flow/block[1]/block[2]/@bpda/ eval expected=14400 xpath=//flow/block[1]/block[2]/@bpd/ -eval expected=16 xpath=//flow/block[1]/block[2]/@ipda/ -eval expected=15 xpath=//flow/block[1]/block[2]/@ipd/ -eval expected=17 xpath=//flow/block[1]/block[2]/@left-offset/ +eval expected=155000 xpath=//flow/block[1]/block[2]/@ipda/ +eval expected=145000 xpath=//flow/block[1]/block[2]/@ipd/ +eval expected=167500 xpath=//flow/block[1]/block[2]/@left-offset/ eval expected=14400 xpath=//flow/block[1]/block[2]/block[1]/@bpda/ eval expected=14400 xpath=//flow/block[1]/block[2]/block[1]/@bpd/ -eval expected=15 xpath=//flow/block[1]/block[2]/block[1]/@ipda/ -eval expected=15 xpath=//flow/block[1]/block[2]/block[1]/@ipd/ +eval expected=145000 xpath=//flow/block[1]/block[2]/block[1]/@ipda/ +eval expected=145000 xpath=//flow/block[1]/block[2]/block[1]/@ipd/ eval expected=5000 5000 5000 5000 xpath=//flow/block[1]/block[2]/@bap/ !-- cell 3 -- eval expected=4 xpath=//flow/block[1]/block[3]/@bpda/ eval expected=3 xpath=//flow/block[1]/block[3]/@bpd/ -eval expected=16 xpath=//flow/block[1]/block[3]/@ipda/ -eval expected=15 xpath=//flow/block[1]/block[3]/@ipd/ -eval expected=5000 xpath=//flow/block[1]/block[3]/@left-offset/ +eval expected=155000 xpath=//flow/block[1]/block[3]/@ipda/ +eval expected=145000 xpath=//flow/block[1]/block[3]/@ipd/ +eval expected=7500 xpath=//flow/block[1]/block[3]/@left-offset/ eval expected=24400 xpath=//flow/block[1]/block[3]/@top-offset/ eval expected=14400 xpath=//flow/block[1]/block[3]/block[1]/@bpda/ eval expected=14400 xpath=//flow/block[1]/block[3]/block[1]/@bpd/ -eval expected=15 xpath=//flow/block[1]/block[3]/block[1]/@ipda/ -eval expected=15 xpath=//flow/block[1]/block[3]/block[1]/@ipd/ +eval expected=145000 xpath=//flow/block[1]/block[3]/block[1]/@ipda/ +eval expected=145000 xpath=//flow/block[1]/block[3]/block[1]/@ipd/ eval expected=5000 5000 5000 5000 xpath=//flow/block[1]/block[3]/@bap/ !-- cell 4 -- eval expected=4 xpath=//flow/block[1]/block[4]/@bpda/ eval expected=2 xpath=//flow/block[1]/block[4]/@bpd/ -eval expected=16 xpath=//flow/block[1]/block[4]/@ipda/ -eval expected=14 xpath=//flow/block[1]/block[4]/@ipd/ -eval expected=175000 xpath=//flow/block[1]/block[4]/@left-offset/ +eval expected=155000 xpath=//flow/block[1]/block[4]/@ipda/ +eval expected=135000 xpath=//flow/block[1]/block[4]/@ipd/ +eval expected=172500 xpath=//flow/block[1]/block[4]/@left-offset/ eval expected=24400 xpath=//flow/block[1]/block[4]/@top-offset/ eval expected=14400 xpath=//flow/block[1]/block[4]/block[1]/@bpda/ eval expected=14400 xpath=//flow/block[1]/block[4]/block[1]/@bpd/ -eval expected=14 xpath=//flow/block[1]/block[4]/block[1]/@ipda/ -eval expected=14 xpath=//flow/block[1]/block[4]/block[1]/@ipd/ +eval expected=135000 xpath=//flow/block[1]/block[4]/block[1]/@ipda/ +eval expected=135000 xpath=//flow/block[1]/block[4]/block[1]/@ipd/ eval expected=1 1 1 1 xpath=//flow/block[1]/block[4]/@bap/ !-- ***
cvs commit: xml-fop/test/layoutengine disabled-testcases.txt
jeremias2005/02/09 07:31:21 Modified:test/layoutengine disabled-testcases.txt Added: test/layoutengine/testcases table-fixed2.xml table-fixed1.xml Log: Test cases for fixed table layout. Revision ChangesPath 1.1 xml-fop/test/layoutengine/testcases/table-fixed2.xml Index: table-fixed2.xml === ?xml version=1.0 encoding=UTF-8? !-- Copyright 2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- $Id: table-fixed2.xml,v 1.1 2005/02/09 15:31:20 jeremias Exp $ -- testcase info p This test checks tables with table-layout=fixed with no table-columns specified. /p p Currently doesn't work. Please see the comment in TableLayoutManager.createColumnsFromFirstRow(). /p /info fo fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:svg=http://www.w3.org/2000/svg; fo:layout-master-set fo:simple-page-master master-name=normal page-width=5in page-height=5in margin=20pt fo:region-body margin=0pt background-color=lightgray/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=normal white-space-collapse=true fo:flow flow-name=xsl-region-body fo:table table-layout=fixed width=300pt border=solid 5pt fo:table-body fo:table-cell width=100pt fo:blockcell1/fo:block /fo:table-cell fo:table-cell background-color=yellow fo:blockcell2/fo:block /fo:table-cell fo:table-cell starts-row=true background-color=orange fo:blockcell3/fo:block /fo:table-cell fo:table-cell fo:blockcell4/fo:block /fo:table-cell /fo:table-body /fo:table /fo:flow /fo:page-sequence /fo:root /fo checks !-- table 1 -- eval expected=31 xpath=//flow/block[1]/@ipda/ eval expected=30 xpath=//flow/block[1]/@ipd/ eval expected=10 xpath=//flow/block[1]/block[1]/@ipda/ eval expected=10 xpath=//flow/block[1]/block[1]/@ipd/ eval expected=20 xpath=//flow/block[1]/block[2]/@ipda/ eval expected=20 xpath=//flow/block[1]/block[2]/@ipd/ /checks /testcase 1.1 xml-fop/test/layoutengine/testcases/table-fixed1.xml Index: table-fixed1.xml === ?xml version=1.0 encoding=UTF-8? !-- Copyright 2005 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -- !-- $Id: table-fixed1.xml,v 1.1 2005/02/09 15:31:20 jeremias Exp $ -- testcase info p This test checks tables with table-layout=fixed. /p /info fo fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:svg=http://www.w3.org/2000/svg; fo:layout-master-set fo:simple-page-master master-name=normal page-width=5in page-height=5in margin=20pt fo:region-body margin=0pt background-color=lightgray/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=normal white-space-collapse=true fo:flow flow-name=xsl-region-body fo:table table-layout=fixed width=100% border=solid 5pt fo:table-column column-width=100pt/ fo:table-column/ fo:table-body fo:table-row fo:table-cell fo:blockcell1/fo:block /fo:table-cell fo:table-cell background-color=yellow fo:blockcell2/fo:block /fo:table-cell
cvs commit: xml-fop/src/java/org/apache/fop/fo/flow Table.java
jeremias2005/02/09 07:38:15 Modified:src/java/org/apache/fop/layoutmgr/table TableLayoutManager.java Body.java src/java/org/apache/fop/fo/flow Table.java Log: No longer fail when no table-columns are defined. The table creates a default column which is used to handle any defaults and inheritance. The columns list is populated with at least the default column. The first row is not yet inspected for determining column widths as described in fixed table layout. (see comment in code) Revision ChangesPath 1.16 +35 -4 xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java Index: TableLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- TableLayoutManager.java 31 Jan 2005 21:16:45 - 1.15 +++ TableLayoutManager.java 9 Feb 2005 15:38:15 - 1.16 @@ -21,6 +21,8 @@ import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.PercentBase; import org.apache.fop.fo.flow.Table; +import org.apache.fop.fo.flow.TableBody; +import org.apache.fop.fo.flow.TableRow; import org.apache.fop.fo.properties.TableColLength; import org.apache.fop.layoutmgr.BlockStackingLayoutManager; import org.apache.fop.layoutmgr.LayoutManager; @@ -62,6 +64,7 @@ private BreakPoss footerBreak; private int referenceIPD; +private boolean autoLayout = true; //TODO space-before|after: handle space-resolution rules private MinOptMax spaceBefore; @@ -78,13 +81,18 @@ /** * Create a new table layout manager. - * + * @param node the table FO */ public TableLayoutManager(Table node) { super(node); fobj = node; } +/** @return the table FO */ +public Table getTable() { +return this.fobj; +} + /** * Set the columns for this table. * @@ -119,6 +127,11 @@ super.initProperties(); spaceBefore = new SpaceVal(fobj.getCommonMarginBlock().spaceBefore).getSpace(); spaceAfter = new SpaceVal(fobj.getCommonMarginBlock().spaceAfter).getSpace(); + +if (!fobj.isAutoLayout() + fobj.getInlineProgressionDimension().getOptimum().getEnum() != EN_AUTO) { +autoLayout = false; +} } private int getIPIndents() { @@ -164,6 +177,10 @@ fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_IPD, referenceIPD); fobj.setLayoutDimension(PercentBase.REFERENCE_AREA_BPD, context.getStackLimit().opt); +if (columns == null) { +createColumnsFromFirstRow(); +} + // either works out table of column widths or if proportional-column-width function // is used works out total factor, so that value of single unit can be computed. int sumCols = 0; @@ -265,6 +282,18 @@ return null; } +private void createColumnsFromFirstRow() { +this.columns = new java.util.ArrayList(); +//TODO Create columns from first row here +//-- rule 2 in fixed table layout, see CSS2, 17.5.2 +//Alternative: extend columns on-the-fly, but in this case we need the +//new property evaluation context so proportional-column-width() works +//correctly. +if (columns.size() == 0) { +this.columns.add(new Column(getTable().getDefaultColumn())); +} +} + /** * Get the break possibility and height of the table header or footer. * @@ -316,6 +345,8 @@ double adjust = layoutContext.getSpaceAdjust(); addBlockSpacing(adjust, spaceBefore); spaceBefore = null; + +int startXOffset = fobj.getCommonMarginBlock().startIndent.getValue(); // add column, body then row areas @@ -329,7 +360,7 @@ List list = pos.list; PositionIterator breakPosIter = new BreakPossPosIter(list, 0, list.size() + 1); while ((childLM = (Body)breakPosIter.getNextChildLM()) != null) { - childLM.setXOffset(fobj.getCommonMarginBlock().startIndent.getValue()); +childLM.setXOffset(startXOffset); childLM.addAreas(breakPosIter, lc); tableHeight += childLM.getBodyHeight(); } @@ -344,7 +375,7 @@ lfp.getLeafPos() + 1); iStartPos = lfp.getLeafPos() + 1; while ((childLM = (Body)breakPosIter.getNextChildLM()) != null) { -
cvs commit: xml-fop/src/documentation/content/xdocs team.xml
gmazza 2005/02/09 23:06:47 Modified:src/documentation/content/xdocs team.xml Log: Updates to team page. Added Luca (Layout) and Simon (Layout, XSL FO Tree, and Properties) to skill sets at bottom--please raise objections soon if you are uncomfortable with being listed. Gave myself my first X (XSL FO Tree), and added more for Jeremias and Finn. Team, please adjust as you feel appropriate. Revision ChangesPath 1.36 +22 -26xml-fop/src/documentation/content/xdocs/team.xml Index: team.xml === RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/team.xml,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- team.xml 6 Dec 2004 05:02:26 - 1.35 +++ team.xml 10 Feb 2005 07:06:47 - 1.36 @@ -33,7 +33,7 @@ is a Java/VB Programmer from England./li li id=adlink href=mailto:[EMAIL PROTECTED]Andreas Delmelle/link (AD)/li !-- Luca prefers the mail address with AT, to stop spam, etc. -- -lilink href=mailto:lfurini AT cs.unibo.itLuca Furini/link +lilink href=mailto:lfurini AT cs.unibo.itLuca Furini/link (LF) is a student of Computer Studies at the University of Bologna (Italy)/li li id=cglink href=mailto:[EMAIL PROTECTED]Christian Geisert/link (CG)/li li id=phlink href=mailto:[EMAIL PROTECTED]Peter Herweg/link (PH) is helping to @@ -52,7 +52,7 @@ li id=gmlink href=mailto:[EMAIL PROTECTED]Glen Mazza/link (GM) is an information systems analyst with EDS in Arlington, Virginia, USA./li !-- Simon prefers the mail address with AT, to stop spam, etc. -- -li id=splink href=mailto:spepping AT leverkruid.nlSimon Pepping/link +li id=splink href=mailto:spepping AT leverkruid.nlSimon Pepping/link (SP) is a TeX/LaTeX and XML expert with Elsevier at its Amsterdam office. See his fork href=http://www.leverkruid.nl;home page/fork for some of his private projects./li @@ -64,11 +64,7 @@ section id=contribute-active titleActive Contributors/title ul -lilink href=mailto:[EMAIL PROTECTED]John Austin/link is an -is an independent software developer currently based in St John's, -Newfoundland. While developing a taste for good seafood, he still isn't ready -for seal flipper (even if it's fresh). He is currently assisting the FOP -project on memory and performance issues./li +liYour name here!/li /ul /section section id=founder @@ -99,63 +95,63 @@ table tr th/ - thCG /th + thCG/th thFB/th thCL/th thJM/th thGM/th thPH/th thJP/th - thOT/th - thPBW/th + thSP/th + thLF/th /tr tr - tdPMC representation/td + tdRelease manager/td + tdX/td + td/ td/ td/ td/ - tdX/td td/ td/ - tdX/td td/ td/ /tr tr - tdRelease manager/td - tdX/td - td/ - td/ - td/ + tdXSL-FO tree/td td/ + tdX/td td/ + tdX/td + tdX/td td/ td/ + tdX/td td/ /tr tr - tdXSL-FO tree/td + tdProperties/td td/ tdX/td td/ - td/ - td/ + tdX/td td/ td/ td/ tdX/td + td/ /tr tr tdLayout/td td/ td/ - td/ + tdX/td td/ td/ td/ tdX/td - td/ - td/ + tdX/td + tdX/td /tr tr tdFonts/td - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]