cvs commit: xml-fop/src/java/org/apache/fop/fo/flow TableBody.java TableFooter.java
spepping2005/03/02 13:03:25 Modified:src/java/org/apache/fop/fo/flow TableBody.java TableFooter.java Log: Corrected a validation problem. Made TableFooter use TableBody's validation. Revision ChangesPath 1.40 +9 -9 xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java Index: TableBody.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableBody.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- TableBody.java2 Mar 2005 01:59:40 - 1.39 +++ TableBody.java2 Mar 2005 21:03:25 - 1.40 @@ -53,8 +53,8 @@ private PropertyList savedPropertyList; -private boolean tableRowsFound = false; -private boolean tableColumnsFound = false; +protected boolean tableRowsFound = false; +protected boolean tableCellsFound = false; /** * @param parent FONode that is the parent of the object @@ -93,7 +93,7 @@ */ protected void endOfNode() throws FOPException { getFOEventHandler().endBody(this); -if (!(tableRowsFound || tableColumnsFound)) { +if (!(tableRowsFound || tableCellsFound)) { if (getUserAgent().validateStrictly()) { missingChildElementError(marker* (table-row+|table-cell+)); } else { @@ -113,21 +113,21 @@ throws ValidationException { if (nsURI == FO_URI) { if (localName.equals(marker)) { -if (tableRowsFound || tableColumnsFound) { +if (tableRowsFound || tableCellsFound) { nodesOutOfOrderError(loc, fo:marker, (table-row+|table-cell+)); } } else if (localName.equals(table-row)) { tableRowsFound = true; -if (tableColumnsFound) { +if (tableCellsFound) { invalidChildError(loc, nsURI, localName, Either fo:table-rows + - or fo:table-columns may be children of an fo:table-body + + or fo:table-cells may be children of an + getName() + but not both); } -} else if (localName.equals(table-column)) { -tableColumnsFound = true; +} else if (localName.equals(table-cell)) { +tableCellsFound = true; if (tableRowsFound) { invalidChildError(loc, nsURI, localName, Either fo:table-rows + - or fo:table-columns may be children of an fo:table-body + + or fo:table-cells may be children of an + getName() + but not both); } } else { 1.13 +2 -38 xml-fop/src/java/org/apache/fop/fo/flow/TableFooter.java Index: TableFooter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/TableFooter.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- TableFooter.java 2 Mar 2005 01:59:40 - 1.12 +++ TableFooter.java 2 Mar 2005 21:03:25 - 1.13 @@ -1,5 +1,5 @@ /* - * Copyright 1999-2004 The Apache Software Foundation. + * Copyright 1999-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. @@ -37,9 +37,6 @@ super(parent); } -private boolean tableRowsFound = false; -private boolean tableColumnsFound = false; - /** * @see org.apache.fop.fo.FONode#startOfNode */ @@ -48,44 +45,11 @@ } /** - * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) - * XSL Content Model: marker* (table-row+|table-cell+) - */ -protected void validateChildNode(Locator loc, String nsURI, String localName) -throws ValidationException { -if (nsURI == FO_URI) { -if (localName.equals(marker)) { -if (tableRowsFound || tableColumnsFound) { - nodesOutOfOrderError(loc, fo:marker, (table-row+|table-cell+)); -} -} else if (localName.equals(table-row)) { -tableRowsFound = true; -if (tableColumnsFound) { -invalidChildError(loc, nsURI, localName, Either fo:table-rows + - or fo:table-columns may be children of an fo:table-footer + - but not both); -} -} else if (localName.equals(table-column)) { -tableColumnsFound = true
cvs commit: xml-fop/src/documentation/content/xdocs/DnI getnextbreakposs.xml areatree.xml
spepping2005/03/01 12:47:48 Modified:src/documentation/content/xdocs/DnI getnextbreakposs.xml areatree.xml Log: Patch 33597 by Renaud Richardet, and a few other edits Revision ChangesPath 1.2 +54 -73 xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml Index: getnextbreakposs.xml === RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- getnextbreakposs.xml 1 Aug 2004 19:48:51 - 1.1 +++ getnextbreakposs.xml 1 Mar 2005 20:47:48 - 1.2 @@ -103,55 +103,39 @@ paraChild layout managers are created and retrieved in the method literalAbstractLayoutManager.getChildLM/literal./para -paraThe layout manager has a layout strategy, which has an -literalAddLMVisitor/literal object, which is responsible for -creating layout managers for the FO nodes./para - -paraThe layout manager gets the layout manager for its next child from its -literalLMIter/literal object literalchildLMIter/literal. This -literalLMIter/literal object contains an iterator over the -children of the layout manager's FO node. It behaves itself as an -iterator over the list of layout managers for the children. It -constructs those layout managers when needed, in its -literalpreLoadNext/literal method. It does so by calling the -layout strategy's literalAddLMVisitor/literal object's -literaladdLayoutManager/literal method. The -literalLMIter/literal object gets the layout strategy via the -current layout manager, which it knows./para - -paraliteralAddLMVisitor/literal's literaladdLayoutManager/literal -method first registers the LM list in its second argument, i.e. the -literalLMIter/literal object's LM list, as its own member -literalcurrentLMlist/literal. Then it asks the FO node to accept -it as the literalFOTreeVisitor/literal -(literalacceptVisitor/literal). The FO node then calls the -appropriate method of this FO tree visitor, in this case -(literalfo:flow/literal) the method literalserveFlow/literal -(literalAddLMVisitor.serveFlow/literal). This method creates a -literalFlowLayoutManager/literal object and adds it to the -literalcurrentLMList/literal. Thus literalLMIter/literal has a -layout manager for its next child. It returns this layout manager in -the call to its literalnext()/literal method, when the current -layout manager invokes its literalgetChildLM/literal method./para - -paraNote that layout manager types may have their own subclass of -literalLMIter/literal, -e.g. literalBlockLayoutManager$BlockLMiter/literal and -literalAbstractList$ListItr/literal, which may implement a -different method of creating child layout managers./para - -paraThe method literalacceptVisitor/literal of the FO node calls the -appropriate method of its visitor. This procedure effectively -implements an indirect mapping from FO node type to layout -manager. The indirection allows the literalAddLMVisitor/literal -object to return its own layout manager for each FO node type. Because -the literalAddLMVisitor/literal object is part of the layout -strategy, this indirection allows the layout strategy to provide its -own layout managers for the layout process. In this manner, a -different layout strategy can be coupled to the other parts of the -program./para +paraThe layout manager gets the layout manager for its next child +from its literalLMIter/literal object +literalchildLMIter/literal. This literalLMIter/literal object +contains an iterator over the children of the layout manager's FO +node. It behaves itself as an iterator over the list of layout +managers for the children. It constructs those layout managers when +needed, in its literalpreLoadNext/literal method, which calls the +convenience method literalpreLoadList/literal. Using the iterator +literalfobjIter/literal, literalpreLoadList/literal iterates +through the children of the current FO-Object and preloads the +corresponding LMs +(literalLayoutManagerMaker.makeLayoutManagers()/literal). Thus +literalLMIter/literal has a layout manager for its next child. It +returns this layout manager in the call to its +literalnext()/literal method, when the current layout manager +invokes its literalgetChildLM/literal method./para + +paraliteralBlockLayoutManager.ProxyLMiter/literal has +its own subclass of literalLMIter/literal, which implements a +different method of creating child layout managers. See the link +linkend=sec.blocklmnext +section/link./para + +paraThe method that creates the LMs, +literalLayoutManagerMaker.makeLayoutManagers()/literal, is +implemented by FOP's implementation of the +literalLayoutManagerMaker/literal interface
cvs commit: xml-fop/src/documentation/content/xdocs/DnI DnI.xml getnextbreakposs.xml
spepping2005/03/01 13:29:37 Modified:src/documentation/content/xdocs/DnI DnI.xml getnextbreakposs.xml Log: A few more changes Revision ChangesPath 1.2 +16 -2 xml-fop/src/documentation/content/xdocs/DnI/DnI.xml Index: DnI.xml === RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/DnI/DnI.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- DnI.xml 9 Nov 2004 20:56:33 - 1.1 +++ DnI.xml 1 Mar 2005 21:29:37 - 1.2 @@ -1,7 +1,7 @@ ?xml version=1.0 encoding=utf-8? !-- - * Copyright 2004 The Apache Software Foundation. + * Copyright 2004-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. @@ -47,10 +47,19 @@ orgdivApache Software Foundation/orgdiv /affiliation /author + author + firstnameRenaud/firstname + surnameRichardet/surname + affiliation + orgnameFOP contributor/orgname + orgdivApache Software Foundation/orgdiv +/affiliation + /author /authorgroup copyright year2004/year + year2005/year holderThe Apache Software Foundation/holder /copyright @@ -81,6 +90,11 @@ date01 August 2004/date revremarkCommitted to the FOP code repository/revremark /revision + revision + revnumber1.0.x/revnumber + date2005/date + revremarkVarious updates, see the FOP code repository/revremark + /revision /revhistory abstract 1.3 +2 -2 xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml Index: getnextbreakposs.xml === RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/DnI/getnextbreakposs.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- getnextbreakposs.xml 1 Mar 2005 20:47:48 - 1.2 +++ getnextbreakposs.xml 1 Mar 2005 21:29:37 - 1.3 @@ -1,7 +1,7 @@ ?xml version=1.0 encoding=utf-8? !-- - * Copyright 2004 The Apache Software Foundation. + * Copyright 2004-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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/test/layoutengine disabled-testcases.txt
spepping2005/02/20 11:52:18 Modified:test/layoutengine disabled-testcases.txt Added: test/layoutengine/testcases markers5c.xml markers5d.xml markers6a.xml markers6b.xml Log: Test case markers5a now works correctly. Added four testcases. Revision ChangesPath 1.1 xml-fop/test/layoutengine/testcases/markers5c.xml Index: markers5c.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: markers5c.xml,v 1.1 2005/02/20 19:52:18 spepping Exp $ -- testcase info p This test checks markers, especially the behaviour of block being broken over pages. /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=1.8in fo:region-body margin=0.5in 0in/ fo:region-before extent=0.5in/ fo:region-after extent=0.5in/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=normal white-space-collapse=true fo:static-content flow-name=xsl-region-before fo:block page fo:page-number/ /fo:block fo:block fo:retrieve-marker retrieve-class-name=previous-total retrieve-boundary=page-sequence retrieve-position=first-including-carryover/ /fo:block /fo:static-content fo:static-content flow-name=xsl-region-after fo:block text-align=end fo:retrieve-marker retrieve-class-name=total retrieve-boundary=page-sequence retrieve-position=last-ending-within-page/ /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block id=id1 fo:marker marker-class-name=previous-total0.00/fo:marker fo:marker marker-class-name=total1.00/fo:marker 1: 1.00 /fo:block fo:block id=id2 fo:marker marker-class-name=previous-total1.00/fo:marker fo:marker marker-class-name=total2.00/fo:marker 2: 1.00 /fo:block fo:block id=id3 fo:marker marker-class-name=previous-total2.00/fo:marker fo:marker marker-class-name=total3.00/fo:marker 3: 1.00 /fo:block fo:block id=id4 fo:marker marker-class-name=previous-total3.00/fo:marker fo:marker marker-class-name=total4.00/fo:marker 4: This is a special case. It must take two lines. It must take two lines. 1.00 /fo:block fo:block id=id5 fo:marker marker-class-name=previous-total4.00/fo:marker fo:marker marker-class-name=total5.00/fo:marker 5: 1.00 /fo:block fo:block id=id6 fo:marker marker-class-name=previous-total5.00/fo:marker fo:marker marker-class-name=total6.00/fo:marker 6: 1.00 /fo:block /fo:flow /fo:page-sequence /fo:root /fo checks !-- page 1 -- eval expected=0.00 xpath=//pageViewport[1]/page/regionViewport[1]/regionBefore/block[2]/lineArea/ eval expected=3.00 xpath=//pageViewport[1]/page/regionViewport[2]/regionAfter/block[1]/lineArea/ eval expected=1: 1.00 xpath=//pageViewport[1]/page/regionViewport[3]/regionBody/mainReference/span/flow/block[1]/lineArea/ eval expected=2: 1.00 xpath=//pageViewport[1]/page/regionViewport[3]/regionBody/mainReference/span/flow/block[2]/lineArea/ eval expected=3: 1.00 xpath=//pageViewport[1]/page/regionViewport[3]/regionBody/mainReference/span/flow/block[3]/lineArea/ !-- page 2 -- eval expected=3.00 xpath=//pageViewport[2]/page/regionViewport[1]/regionBefore/block[2]/lineArea/ eval expected=6.00 xpath=//pageViewport[2]/page/regionViewport[2]/regionAfter/block[1]/lineArea/ eval expected=5: 1.00 xpath=//pageViewport[2]/page/regionViewport[3]/regionBody/mainReference/span/flow/block[2]/lineArea/ eval expected=6: 1.00 xpath=//pageViewport[2]/page/regionViewport[3]/regionBody/mainReference/span/flow/block[3
cvs commit: xml-fop/src/documentation/content/xdocs/DnI areatree.xml
spepping2005/01/30 11:56:45 Modified:src/documentation/content/xdocs/DnI areatree.xml Log: Updated to the current situation. Patch by renaud richardet, see bug 33126 Revision ChangesPath 1.2 +70 -101 xml-fop/src/documentation/content/xdocs/DnI/areatree.xml Index: areatree.xml === RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/DnI/areatree.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- areatree.xml 1 Aug 2004 19:48:51 - 1.1 +++ areatree.xml 30 Jan 2005 19:56:45 - 1.2 @@ -1,7 +1,7 @@ ?xml version=1.0 encoding=utf-8? !-- - * Copyright 2004 The Apache Software Foundation. + * Copyright 2004-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. @@ -29,109 +29,78 @@ section titleInitiating the layout process/title -paraIn the literalPageSequence.end()/literal method the -literalFOTreeHandler/literal object -literalfoInputHandler/literal notifies the -literalFOTreeListeners/literal of the PageSequence-end -event. There is only one listener, the -literalFOTreeControl/literal object -literalfoTreeControl/literal. This listener asks its -literalLayoutManagerLS/literal object to format the FO subtree of -the literalPageSequence/literal FO node. This object constructs a -literalPageLayoutManager/literal for the -literalPageSequence/literal FO node, which does the work./para - -screen -org.apache.fop.fo.pagination.PageSequence.end(): -this.getFOTreeControl().getFOInputHandler().endPageSequence(this): -- foTreeControl.getFOInputHandler().endPageSequence(this) -- foInputHandler.endPageSequence(this) (type FOTreeHandler): -/screen - -paraThis method only calls -literalFOTreeHandler.notifyPageSequenceComplete(pageSequence)/literal, -which notifies the literalFOTreeListeners/literal of the -PageSequence-end event. The literalPageSequence/literal object -attaches itself to the event, from which the listeners can retrieve it -again./para - -paraThere is only one listener. It is an -literalorg.apache.fop.apps.Document/literal object. It is the same -object as literalpageSequence.root.foTreeControl/literal. Its -method literalfoPageSequenceComplete(event)/literal is called, -which is a method of the literalFOTreeListener/literal -interface. It handles an literalFOTreeEvent/literal that is fired -when a literalPageSequence/literal object has been -completed./para - -paraThe listener formats the FO subtree of the -literalPageSequence/literal FO node. It calls its layout -strategy's method literalLayoutManagerLS.format(pageSeq, -areaTree)/literal./para - -paraThis method creates a new literalPageLayoutManager/literal -for the literalPageSequence/literal FO node and calls its -literalrun/literal method (could start another thread). The pages -in this page sequence are completely layed out by the -literalPageLayoutManager/literal, in its -literaldoLayout/literal method. The first step in the layout -process is getting the page setup from the page masters. Then the FO -tree is processed./para - -screen - [1] org.apache.fop.layoutmgr.PageLayoutManager.doLayout (PageLayoutManager.java:220) - [2] org.apache.fop.layoutmgr.PageLayoutManager.run (PageLayoutManager.java:208) - [3] org.apache.fop.layoutmgr.LayoutManagerLS.format (LayoutManagerLS.java:83) - [4] org.apache.fop.apps.Document.foPageSequenceComplete (Document.java:348) - [5] org.apache.fop.fo.FOTreeHandler.notifyPageSequenceComplete (FOTreeHandler.java:497) - [6] org.apache.fop.fo.FOTreeHandler.endPageSequence (FOTreeHandler.java:215) - [7] org.apache.fop.fo.pagination.PageSequence.end (PageSequence.java:350) - [8] org.apache.fop.fo.FOTreeBuilder.endElement (FOTreeBuilder.java:223) +paraIn the literalPageSequence.endOfNode()/literal method, the +literalAreaTreeHandler/literal object +literalfoEventHandler/literal's method +literalendPageSequence/literal is called. This method constructs a +literalPageSequenceLayoutManager/literal for the +literalPageSequence/literal FO node, which manages all page-related +layout./para + +screen +org.apache.fop.fo.pagination.PageSequence.endOfNode(): +this.getFOEventHandler().getFOEventHandler().endPageSequence(this): +- foTreeBuilder.getFOEventHandler().endPageSequence(this) +- foEventHandler.endPageSequence(this) (type AreaTreeHandler): +/screen + +paraThis method creates a new +literalPageSequenceLayoutManager/literal for the +literalPageSequence/literal FO node. The pages in this page sequence +are completely layed out by the +literalPageSequenceLayoutManager/literal, in its +literalactivateLayout/literal method
cvs commit: xml-fop build.xml
spepping2005/01/12 11:50:36 Modified:.build.xml Log: Fixed an error in the classpath of one of the junit tests Revision ChangesPath 1.113 +1 -0 xml-fop/build.xml Index: build.xml === RCS file: /home/cvs/xml-fop/build.xml,v retrieving revision 1.112 retrieving revision 1.113 diff -u -r1.112 -r1.113 --- build.xml 6 Jan 2005 19:20:37 - 1.112 +++ build.xml 12 Jan 2005 19:50:36 - 1.113 @@ -696,6 +696,7 @@ formatter type=brief usefile=false/ classpath pathelement location=${build.dir}/test-classes/ +path refid=libs-basic-run-classpath/ fileset dir=build include name=fop-transcoder-allinone.jar/ /fileset - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/area AreaTreeHandler.java
spepping2004/12/27 02:13:05 Modified:src/java/org/apache/fop/layoutmgr LayoutManagerMaker.java LayoutManagerMapping.java PageSequenceLayoutManager.java src/java/org/apache/fop/area AreaTreeHandler.java Log: Changed LayoutManagerMaker.makeLayoutManager(FONode node) to throw a FOPException, and removed LayoutManagerMaker.makeLayoutManager(FONode node, boolean checkLength). Adapted LayoutManagerMapping, PageSequenceLM and AreaTreeHandler. Revision ChangesPath 1.2 +19 -4 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java Index: LayoutManagerMaker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- LayoutManagerMaker.java 24 Dec 2004 12:06:26 - 1.1 +++ LayoutManagerMaker.java 27 Dec 2004 10:13:05 - 1.2 @@ -19,14 +19,29 @@ import java.util.List; import org.apache.fop.fo.FONode; +import org.apache.fop.apps.FOPException; +/** + * The interface for all LayoutManager makers + */ public interface LayoutManagerMaker { +/** + * Make LayoutManagers for the node and add them to the list lms. + * @param node the FO node for which the LayoutManagers are made + * @param lms the list to which the LayoutManagers are added + */ public void makeLayoutManagers(FONode node, List lms); -public LayoutManager makeLayoutManager(FONode node); - -public LayoutManager makeLayoutManager(FONode node, boolean checkLength); +/** + * Make the LayoutManager for the node. + * If not exactly one LayoutManagers is made, + * a FOPException is thrown. + * @param node the FO node for which the LayoutManagers are made + * @return The created LayoutManager + */ +public LayoutManager makeLayoutManager(FONode node) +throws FOPException; } 1.3 +217 -211 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java Index: LayoutManagerMapping.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LayoutManagerMapping.java 25 Dec 2004 01:08:10 - 1.2 +++ LayoutManagerMapping.java 27 Dec 2004 10:13:05 - 1.3 @@ -17,9 +17,6 @@ /* $Id$ */ package org.apache.fop.layoutmgr; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import java.util.ArrayList; import java.util.Map; import java.util.HashMap; @@ -27,6 +24,11 @@ import java.util.ListIterator; import java.util.Iterator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.apache.fop.apps.FOPException; + import org.apache.fop.fo.FONode; import org.apache.fop.fo.FOText; import org.apache.fop.fo.FObj; @@ -74,7 +76,7 @@ import org.apache.fop.layoutmgr.table.TableLayoutManager; /** - * The default class for creating layout managers. + * The default LayoutManager maker class */ public class LayoutManagerMapping implements LayoutManagerMaker { @@ -92,175 +94,179 @@ * Initializes the set of maker objects associated with this LayoutManagerMapping */ private void initialize() { - makers.put(FOText.class, new FOTextLayoutManagerMaker()); - makers.put(FObjMixed.class, new Maker()); - makers.put(BidiOverride.class, new BidiOverrideLayoutManagerMaker()); - makers.put(Inline.class, new InlineLayoutManagerMaker()); - makers.put(Footnote.class, new FootnodeLayoutManagerMaker()); - makers.put(InlineContainer.class, +makers.put(FOText.class, new FOTextLayoutManagerMaker()); +makers.put(FObjMixed.class, new Maker()); +makers.put(BidiOverride.class, new BidiOverrideLayoutManagerMaker()); +makers.put(Inline.class, new InlineLayoutManagerMaker()); +makers.put(Footnote.class, new FootnodeLayoutManagerMaker()); +makers.put(InlineContainer.class, new InlineContainerLayoutManagerMaker()); - makers.put(BasicLink.class, new BasicLinkLayoutManagerMaker()); - makers.put(Block.class, new BlockLayoutManagerMaker()); - makers.put(Leader.class, new LeaderLayoutManagerMaker()); - makers.put(RetrieveMarker.class, new WrapperLayoutManagerMaker()); - makers.put(Character.class, new CharacterLayoutManagerMaker()); - makers.put(ExternalGraphic.class, +makers.put(BasicLink.class, new BasicLinkLayoutManagerMaker()); +makers.put(Block.class, new
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr LayoutManagerMaker.java LayoutManagerMapping.java AbstractLayoutManager.java ContentLayoutManager.java LayoutManager.java PageSequenceLayoutManager.java
spepping2004/12/24 04:06:26 Modified:src/java/org/apache/fop/apps FOUserAgent.java src/java/org/apache/fop/area AreaTreeHandler.java src/java/org/apache/fop/fo FONode.java FOText.java FObjMixed.java src/java/org/apache/fop/fo/flow BasicLink.java BidiOverride.java Block.java BlockContainer.java Character.java ExternalGraphic.java Footnote.java Inline.java InlineContainer.java InlineLevel.java InstreamForeignObject.java Leader.java ListBlock.java ListItem.java Marker.java PageNumber.java PageNumberCitation.java RetrieveMarker.java Table.java TableBody.java TableCell.java TableRow.java Wrapper.java src/java/org/apache/fop/fo/pagination Flow.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java ContentLayoutManager.java LayoutManager.java PageSequenceLayoutManager.java Added: src/java/org/apache/fop/layoutmgr LayoutManagerMaker.java LayoutManagerMapping.java Log: This patch implements a pluggable LayoutManagers system, according to the ideas of Finn Bock and his patch in bug 30500. Created a LayoutManagerMaker interface, with method makeLayoutManagers(FONode, List), and two convenience methods on top of it. Created an implementation: LayoutManagerMapping. This is along the pattern of FOElementMapping. It creates a Map from FObj class to Maker objects. There are many static inner classes which are subclasses of Maker. Each subclass implements its own version of the make method. FOUserAgent has a setter and getter for LayoutManagerMakerOverride. AreaTreeHandler creates a LayoutManagerMaker, taking the user's override into account, using LayoutManagerMapping as the default. It has a get method for it. The LayoutManager interface has a get method for the AreaTreeHandler object, a reference to which is held in PageSequenceLM, the top of the LM tree. Revision ChangesPath 1.20 +20 -1 xml-fop/src/java/org/apache/fop/apps/FOUserAgent.java Index: FOUserAgent.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/apps/FOUserAgent.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- FOUserAgent.java 24 Oct 2004 00:03:49 - 1.19 +++ FOUserAgent.java 24 Dec 2004 12:06:25 - 1.20 @@ -37,6 +37,7 @@ // FOP import org.apache.fop.fo.ElementMapping; import org.apache.fop.fo.FOEventHandler; +import org.apache.fop.layoutmgr.LayoutManagerMaker; import org.apache.fop.pdf.PDFEncryptionParams; import org.apache.fop.render.Renderer; @@ -74,6 +75,7 @@ private InputHandler inputHandler = null; private Renderer rendererOverride = null; private FOEventHandler foEventHandlerOverride = null; +private LayoutManagerMaker lmMakerOverride = null; /* user configuration */ private Configuration userConfig = null; private Log log = LogFactory.getLog(FOP); @@ -164,6 +166,23 @@ */ public FOEventHandler getFOEventHandlerOverride() { return this.foEventHandlerOverride; +} + +/** + * Sets an explicit LayoutManagerMaker instance which overrides the one + * defined by the AreaTreeHandler. + * @param lmMaker the LayoutManagerMaker instance + */ +public void setLayoutManagerMakerOverride(LayoutManagerMaker lmMaker) { +this.lmMakerOverride = lmMaker; +} + +/** + * Returns the overriding LayoutManagerMaker instance, if any. + * @return the overriding LayoutManagerMaker or null + */ +public LayoutManagerMaker getLayoutManagerMakerOverride() { +return this.lmMakerOverride; } /** 1.28 +24 -3 xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java Index: AreaTreeHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- AreaTreeHandler.java 17 Dec 2004 00:19:10 - 1.27 +++ AreaTreeHandler.java 24 Dec 2004 12:06:25 - 1.28 @@ -40,6 +40,8 @@ import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.Root; import org.apache.fop.layoutmgr.PageSequenceLayoutManager; +import org.apache.fop.layoutmgr.LayoutManagerMaker; +import org.apache.fop.layoutmgr.LayoutManagerMapping; /** * Area tree handler for formatting objects. @@ -72,6 +74,9 @@ // time used in rendering
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
spepping2004/12/21 03:28:06 Modified:src/java/org/apache/fop/fo FONode.java FObj.java src/java/org/apache/fop/fo/flow Marker.java RetrieveMarker.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java Log: Implemented cloning and reparenting of the subtree under a marker to the retrieving retrieve-marker. The FO nodes are cloned. The new subtree is attached to the RetrieveMarker object. The property lists are not cloned. The subtree of property lists is attached to the property list of the RetrieveMarker object. This is only needed for the binding of the FO nodes. After that a subsequent retrieve-marker may reparent the property lists. Removed Marker's reference to its property list. In Marker.endOfNode() the parent of the property lists of the direct children of marker is reset to null. FOText nodes are not mapped to the Marker's property list in Marker. This allows the Marker's property list and its ancestors to be GC'ed. FOText nodes use the parent FO node's property list or the RetrieveMarker's property list for binding. TODO: Block.handleWhiteSpace is not applied to text in retrieve-marker. TODO: White space treatment around retrieve-marker is incorrect. Revision ChangesPath 1.50 +29 -1 xml-fop/src/java/org/apache/fop/fo/FONode.java Index: FONode.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FONode.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- FONode.java 28 Oct 2004 10:00:19 - 1.49 +++ FONode.java 21 Dec 2004 11:28:05 - 1.50 @@ -37,7 +37,7 @@ /** * base class for nodes in the XML tree */ -public abstract class FONode { +public abstract class FONode implements Cloneable { protected static String FO_URI = FOElementMapping.URI; @@ -60,6 +60,34 @@ */ protected FONode(FONode parent) { this.parent = parent; +} + +/** + * Perform a shallow cloning operation, + * set its parent, and optionally clean the list of child nodes + * @param parent the intended parent of the clone + * @param removeChildren if true, clean the list of child nodes + * @return the cloned FO node + */ +public FONode clone(FONode parent, boolean removeChildren) +throws FOPException { +FONode foNode = (FONode) clone(); +foNode.parent = parent; +parent.addChildNode(foNode); +return foNode; +} + +/** + * Perform a shallow cloning operation + * + * @see java.lang.Object#clone() + * @return the cloned object + */ +protected Object clone() { +try { +return super.clone(); +} catch (CloneNotSupportedException e) { } +return null; } /** 1.87 +12 -0 xml-fop/src/java/org/apache/fop/fo/FObj.java Index: FObj.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObj.java,v retrieving revision 1.86 retrieving revision 1.87 diff -u -r1.86 -r1.87 --- FObj.java 28 Oct 2004 10:00:19 - 1.86 +++ FObj.java 21 Dec 2004 11:28:05 - 1.87 @@ -86,6 +86,18 @@ } /** + * @see org.apache.fop.fo.FONode#clone(FONode, boolean) + */ +public FONode clone(FONode parent, boolean removeChildren) +throws FOPException { +FObj fobj = (FObj) super.clone(parent, removeChildren); +if (removeChildren) { +fobj.childNodes = null; +} +return fobj; +} + +/** * @see org.apache.fop.fo.FONode#processNode */ public void processNode(String elementName, Locator locator, 1.22 +21 -36xml-fop/src/java/org/apache/fop/fo/flow/Marker.java Index: Marker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Marker.java 7 Dec 2004 20:11:21 - 1.21 +++ Marker.java 21 Dec 2004 11:28:05 - 1.22 @@ -45,9 +45,8 @@ private String markerClassName; // End of property values -private MarkerPropertyList propertyList; private PropertyListMaker savePropertyListMaker; -private HashMap children = new HashMap(); +private HashMap descPLists = new HashMap(); /** * Create a marker fo. @@ -65,27 +64,16 @@ } /** - * Rebind the marker and all the children using the specified - * parentPropertyList which comes from the fo:retrieve-marker element
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java PageSequenceLayoutManager.java BlockLayoutManager.java RetrieveMarkerLayoutManager.java
spepping2004/12/07 12:11:22 Modified:src/java/org/apache/fop/fo/flow Marker.java RetrieveMarker.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java PageSequenceLayoutManager.java BlockLayoutManager.java Removed: src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java Log: Removed RetrieveMarkerLM. The LMs of the marker children are attached in the LM tree as the direct children of the LM of the parent of the RetrieveMarker. This patch solves bug 32253. Revision ChangesPath 1.21 +19 -1 xml-fop/src/java/org/apache/fop/fo/flow/Marker.java Index: Marker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Marker.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- Marker.java 30 Nov 2004 20:20:59 - 1.20 +++ Marker.java 7 Dec 2004 20:11:21 - 1.21 @@ -20,6 +20,9 @@ import java.util.HashMap; import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; + import org.xml.sax.Locator; @@ -70,7 +73,7 @@ // Set a new parent property list and bind all the children again. propertyList.setParentPropertyList(parentPropertyList); for (Iterator i = children.keySet().iterator(); i.hasNext(); ) { -Object child = i.next(); +FONode child = (FONode) i.next(); PropertyList childList = (PropertyList) children.get(child); if (child instanceof FObj) { ((FObj) child).bind(childList); @@ -123,6 +126,21 @@ throws ValidationException { if (!isBlockOrInlineItem(nsURI, localName)) { invalidChildError(loc, nsURI, localName); +} +} + +/** + * @see org.apache.fop.fo.FONode#addLayoutManager(List) + * @todo remove null check when vCN() endOfNode() implemented + */ +public void addLayoutManager(List list) { +ListIterator baseIter = getChildNodes(); +if (baseIter == null) { +return; +} +while (baseIter.hasNext()) { +FONode child = (FONode) baseIter.next(); +child.addLayoutManager(list); } } 1.24 +11 -8 xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java Index: RetrieveMarker.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/RetrieveMarker.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- RetrieveMarker.java 28 Oct 2004 10:00:21 - 1.23 +++ RetrieveMarker.java 7 Dec 2004 20:11:21 - 1.24 @@ -23,6 +23,8 @@ import org.xml.sax.Locator; +import org.apache.commons.logging.Log; + import org.apache.fop.apps.FOPException; import org.apache.fop.fo.FOEventHandler; import org.apache.fop.fo.FONode; @@ -30,7 +32,7 @@ import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.StaticPropertyList; import org.apache.fop.fo.ValidationException; -import org.apache.fop.layoutmgr.RetrieveMarkerLayoutManager; +import org.apache.fop.layoutmgr.LayoutManager; /** @@ -108,13 +110,14 @@ return retrieveBoundary; } - -/** - * @see org.apache.fop.fo.FONode#addLayoutManager(List) - */ -public void addLayoutManager(List list) { -RetrieveMarkerLayoutManager lm = new RetrieveMarkerLayoutManager(this); -list.add(lm); +public void bindMarker(Marker marker) { +// assert(marker != null); +try { +marker.rebind(getPropertyList()); +} catch (FOPException exc) { +Log log = getLogger(); +log.error(fo:retrieve-marker unable to rebind property values, exc); +} } /** 1.32 +12 -0 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- AbstractLayoutManager.java13 Nov 2004 20:37:17 - 1.31 +++ AbstractLayoutManager.java7 Dec 2004 20:11:21 - 1.32 @@ -24,6 +24,7 @@ import org.apache.fop.area.Resolvable; import org.apache.fop.area.PageViewport; import org.apache.fop.fo.Constants; +import org.apache.fop.fo.flow.RetrieveMarker; import org.apache.fop.fo.flow.Marker; import org.apache.commons.logging.Log; @@ -373,6
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr LineLayoutManager.java
spepping2004/11/15 12:58:20 Modified:src/java/org/apache/fop/layoutmgr LineLayoutManager.java Log: A quick and dirty hack to prevent the IndexOutOfBoundsException reported in bug 32174. Revision ChangesPath 1.34 +6 -0 xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java Index: LineLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- LineLayoutManager.java13 Nov 2004 20:37:17 - 1.33 +++ LineLayoutManager.java15 Nov 2004 20:58:20 - 1.34 @@ -480,6 +480,12 @@ } knuthPar.endParagraph(); +// emergency patch +if (knuthParagraphs.size() == 0) { +setFinished(true); +return null; +} + // find the optimal line breaking points for each paragraph ListIterator paragraphsIterator = knuthParagraphs.listIterator(knuthParagraphs.size()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java
spepping2004/11/15 13:01:40 Modified:src/java/org/apache/fop/layoutmgr RetrieveMarkerLayoutManager.java Log: Made RetrieveMarkerLM implement InlineLevelLM. Revision ChangesPath 1.16 +66 -1 xml-fop/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java Index: RetrieveMarkerLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/RetrieveMarkerLayoutManager.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- RetrieveMarkerLayoutManager.java 13 Nov 2004 20:37:17 - 1.15 +++ RetrieveMarkerLayoutManager.java 15 Nov 2004 21:01:40 - 1.16 @@ -30,7 +30,9 @@ /** * LayoutManager for a block FO. */ -public class RetrieveMarkerLayoutManager extends AbstractLayoutManager { +public class RetrieveMarkerLayoutManager extends AbstractLayoutManager +implements InlineLevelLayoutManager { + private RetrieveMarker fobj; private LayoutManager replaceLM = null; @@ -67,6 +69,9 @@ return replaceLM.getNextBreakPoss(context); } +/** + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#getNextKnuthElements + */ public LinkedList getNextKnuthElements(LayoutContext context, int alignment) { loadLM(); @@ -75,6 +80,66 @@ } return ((InlineLevelLayoutManager) replaceLM) .getNextKnuthElements(context, alignment); +} + +/** + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#addALetterSpaceTo + */ +public KnuthElement addALetterSpaceTo(KnuthElement element) { +loadLM(); +if (replaceLM == null) { +return null; +} +return ((InlineLevelLayoutManager) replaceLM) +.addALetterSpaceTo(element); +} + +/** + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#getWordChars + */ +public void getWordChars(StringBuffer sbChars, Position pos) { +loadLM(); +if (replaceLM != null) { +((InlineLevelLayoutManager) replaceLM) +.getWordChars(sbChars, pos); +} +} + +/** + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#hyphenate + */ +public void hyphenate(Position pos, HyphContext hc) { +loadLM(); +if (replaceLM != null) { +((InlineLevelLayoutManager) replaceLM).hyphenate(pos, hc); +} +} + +/** + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#applyChanges + */ +public boolean applyChanges(List oldList) { +loadLM(); +if (replaceLM == null) { +return false; +} +return ((InlineLevelLayoutManager) replaceLM) +.applyChanges(oldList); +} + +/** + * @see org.apache.fop.layoutmgr.InlineLevelLayoutManager#getChangedKnuthElements + */ +public LinkedList getChangedKnuthElements(List oldList, + int flaggedPenalty, + int alignment) { +loadLM(); +if (replaceLM == null) { +return null; +} +return ((InlineLevelLayoutManager) replaceLM) + .getChangedKnuthElements(oldList, flaggedPenalty, +alignment); } public void addAreas(PositionIterator parentIter, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/documentation/content/xdocs/DnI DnI.xml Makefile README book.xml
spepping2004/11/09 12:56:33 Modified:src/documentation/content/xdocs/DnI Makefile README Added: src/documentation/content/xdocs/DnI DnI.xml Removed: src/documentation/content/xdocs/DnI book.xml Log: Renamed book.xml to DnI.xml to prevent confusion with the forrest book.xml naming convention. Revision ChangesPath 1.2 +11 -11xml-fop/src/documentation/content/xdocs/DnI/Makefile Index: Makefile === RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/DnI/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- Makefile 1 Aug 2004 19:48:51 - 1.1 +++ Makefile 9 Nov 2004 20:56:33 - 1.2 @@ -14,7 +14,7 @@ # $Id$ -BOOK=book.xml +BOOK=DnI.xml CHAPTERS=addareas.xml areatree.xml configuration.xml fonts.xml \ foptrees.xml fotree.xml getnextbreakposs.xml overview.xml \ preparation.xml properties.xml rendering.xml @@ -27,7 +27,7 @@ BOOKMAKER=BookMaker.java # destinations -BUILD_DIR=../../../../../build/ +BUILD_DIR=../../../../../build BOOKMAKERCLASSPATH=$(BUILD_DIR)/classes BOOKMAKER_CLASS=$(BOOKMAKERCLASSPATH)/BookMaker.class DNI_BUILD_DIR=$(BUILD_DIR)/site/DnI @@ -45,30 +45,30 @@ all: xhtml html pdf -xhtml: $(XHTML_DIR)/book-xhtml.xml -html: $(HTML_DIR)/book.html -fo: $(PDF_DIR)/book.fo -pdf: $(PDF_DIR)/book.pdf +xhtml: $(XHTML_DIR)/DnI-xhtml.xml +html: $(HTML_DIR)/DnI.html +fo: $(PDF_DIR)/DnI.fo +pdf: $(PDF_DIR)/DnI.pdf -$(XHTML_DIR)/book-xhtml.xml: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_XHTML_STYLESHEET) $(BOOKMAKER_CLASS) +$(XHTML_DIR)/DnI-xhtml.xml: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_XHTML_STYLESHEET) $(BOOKMAKER_CLASS) [ -d $(XHTML_DIR) ] || mkdir -p $(XHTML_DIR) java $(JAVAFLAGS) \ -classpath $(XERCESCLASSPATH):$(SAXONCLASSPATH):$(AVALONCLASSPATH):$(RESOLVERCLASSPATH):$(CLICLASSPATH):$(BOOKMAKERCLASSPATH):$(CLASSPATH) \ BookMaker $(PROGOPTS) --parameter base.dir $(XHTML_DIR)/ -xml $ -xsl $(CUSTOM_DOCBOOK_XHTML_STYLESHEET) -out $@ -$(HTML_DIR)/book.html: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_HTML_STYLESHEET) $(BOOKMAKER_CLASS) +$(HTML_DIR)/DnI.html: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_HTML_STYLESHEET) $(BOOKMAKER_CLASS) [ -d $(HTML_DIR) ] || mkdir -p $(HTML_DIR) java $(JAVAFLAGS) \ -classpath $(XERCESCLASSPATH):$(SAXONCLASSPATH):$(AVALONCLASSPATH):$(RESOLVERCLASSPATH):$(CLICLASSPATH):$(BOOKMAKERCLASSPATH):$(CLASSPATH) \ BookMaker $(PROGOPTS) --parameter base.dir $(HTML_DIR)/ -xml $ -xsl $(CUSTOM_DOCBOOK_HTML_STYLESHEET) -out $@ -$(PDF_DIR)/book.fo: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_FO_STYLESHEET) $(BOOKMAKER_CLASS) +$(PDF_DIR)/DnI.fo: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_FO_STYLESHEET) $(BOOKMAKER_CLASS) [ -d $(PDF_DIR) ] || mkdir -p $(PDF_DIR) java $(JAVAFLAGS) \ -classpath $(XERCESCLASSPATH):$(SAXONCLASSPATH):$(AVALONCLASSPATH):$(RESOLVERCLASSPATH):$(CLICLASSPATH):$(BOOKMAKERCLASSPATH):$(CLASSPATH) \ BookMaker $(PROGOPTS) -xml $ -xsl $(CUSTOM_DOCBOOK_FO_STYLESHEET) -out $@ -$(PDF_DIR)/book.pdf: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_FO_STYLESHEET) $(BOOKMAKER_CLASS) +$(PDF_DIR)/DnI.pdf: $(BOOK) $(CHAPTERS) $(CUSTOM_DOCBOOK_FO_STYLESHEET) $(BOOKMAKER_CLASS) [ -d $(PDF_DIR) ] || mkdir -p $(PDF_DIR) java $(JAVAFLAGS) \ -classpath $(XERCESCLASSPATH):$(SAXONCLASSPATH):$(FOPCLASSPATH):$(AVALONCLASSPATH):$(RESOLVERCLASSPATH):$(CLICLASSPATH):$(BOOKMAKERCLASSPATH):$(CLASSPATH) \ 1.2 +5 -5 xml-fop/src/documentation/content/xdocs/DnI/README Index: README === RCS file: /home/cvs/xml-fop/src/documentation/content/xdocs/DnI/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- README1 Aug 2004 19:48:51 - 1.1 +++ README9 Nov 2004 20:56:33 - 1.2 @@ -6,7 +6,7 @@ The book is structured according to the Docbook XML DTD version 4.2, top-level element book. -The top level file is book.xml. It calls in the various chapter files. +The top level file is DnI.xml. It calls in the various chapter files. The book can be converted to XHTML, HTML and FO using the Docbook XSL stylesheets. For each of these formats there are customization XSL @@ -59,17 +59,17 @@ java $JAVAFLAGS -cp $SAXONCLASSPATH:$CLASSPATH \ com.icl.saxon.StyleSheet \ -o ../documentation-xhtml/book-xhtml.xml \ - book.xml cust-xhtml-docbook.xsl + DnI.xml cust-xhtml-docbook.xsl java $JAVAFLAGS -cp $SAXONCLASSPATH:$CLASSPATH \ com.icl.saxon.StyleSheet \ -o ../documentation-html/book.html \ - book.xml cust-html-docbook.xsl
cvs commit: xml-fop/src/java/org/apache/fop/render/xml XMLRenderer.java
spepping2004/09/05 11:16:32 Modified:src/java/org/apache/fop/area/inline Character.java TextArea.java src/java/org/apache/fop/fo PropertyManager.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java CharacterLayoutManager.java ContentLayoutManager.java InlineStackingLayoutManager.java LayoutContext.java LayoutManager.java LeaderLayoutManager.java LeafNodeLayoutManager.java LineLayoutManager.java TextLayoutManager.java src/java/org/apache/fop/render/pdf PDFRenderer.java src/java/org/apache/fop/render/xml XMLRenderer.java Log: New line breaking algorithm, patch 29124, submitted by Luca Furini. This patch implements the algorithm for most but not yet all inline layout managers. For the algorithm, see D.E. Knuth and M.F. Plass, Breaking paragraphs into lines, Software, Practice and Experience 11 (1981) 1119-1184; reprinted in: D. E. Knuth, Digital typography, CSLI Lecture Notes Number 78 (CLSI Publications, Stanford, CA, USA) pp. 67-155. Revision ChangesPath 1.5 +55 -4 xml-fop/src/java/org/apache/fop/area/inline/Character.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/area/inline/Character.java.diff?r1=1.4r2=1.5 1.5 +28 -10xml-fop/src/java/org/apache/fop/area/inline/TextArea.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/area/inline/TextArea.java.diff?r1=1.4r2=1.5 1.34 +35 -15xml-fop/src/java/org/apache/fop/fo/PropertyManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/fo/PropertyManager.java.diff?r1=1.33r2=1.34 1.21 +39 -0 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java.diff?r1=1.20r2=1.21 1.2 +217 -1 xml-fop/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java.diff?r1=1.1r2=1.2 1.13 +30 -0 xml-fop/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java.diff?r1=1.12r2=1.13 1.11 +233 -11 xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java.diff?r1=1.10r2=1.11 1.6 +1 -0 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutContext.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutContext.java.diff?r1=1.5r2=1.6 1.11 +15 -0 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java.diff?r1=1.10r2=1.11 1.4 +103 -1 xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java.diff?r1=1.3r2=1.4 1.7 +114 -6 xml-fop/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java.diff?r1=1.6r2=1.7 1.25 +1002 -225 xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java.diff?r1=1.24r2=1.25 1.18 +521 -77 xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java.diff?r1=1.17r2=1.18 1.48 +68 -2 xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java.diff?r1=1.47r2=1.48 1.26 +2 -1 xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java http://cvs.apache.org/viewcvs/xml-fop/src/java/org/apache/fop/render/xml/XMLRenderer.java.diff?r1=1.25r2=1.26 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr LayoutManager.java AbstractLayoutManager.java BasicLinkLayoutManager.java BlockLayoutManager.java ContentLayoutManager.java InlineStackingLayoutManager.java LMiter.java LeaderLayoutManager.java LineLayoutManager.java
spepping2004/08/26 13:58:31 Modified:src/java/org/apache/fop/area AreaTreeHandler.java src/java/org/apache/fop/fo FObjMixed.java src/java/org/apache/fop/layoutmgr LayoutManager.java AbstractLayoutManager.java BasicLinkLayoutManager.java BlockLayoutManager.java ContentLayoutManager.java InlineStackingLayoutManager.java LMiter.java LeaderLayoutManager.java LineLayoutManager.java Log: Moved some functionality from LMiter to the LayoutManagers. The LMs now hold the list of child LMs and the method preLoadNext. This makes it possible to create a new LMiter object for a LM, or even a list iterator over the list of child LMs if the latter is known to be complete. Revision ChangesPath 1.5 +7 -9 xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java Index: AreaTreeHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/AreaTreeHandler.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AreaTreeHandler.java 20 Aug 2004 09:38:21 - 1.4 +++ AreaTreeHandler.java 26 Aug 2004 20:58:30 - 1.5 @@ -432,20 +432,18 @@ * @return the Title area */ private org.apache.fop.area.Title getTitleArea(org.apache.fop.fo.pagination.Title foTitle) { -// use special layout manager to add the inline areas -// to the Title. -InlineStackingLayoutManager lm; -lm = new InlineStackingLayoutManager(foTitle); -lm.setLMiter(new LMiter(lm, foTitle.getChildNodes())); -lm.initialize(); - // get breaks then add areas to title org.apache.fop.area.Title title = new org.apache.fop.area.Title(); ContentLayoutManager clm = new ContentLayoutManager(title); clm.setUserAgent(foTitle.getUserAgent()); -lm.setParent(clm); + +// use special layout manager to add the inline areas +// to the Title. +InlineStackingLayoutManager lm; +lm = new InlineStackingLayoutManager(foTitle); +clm.addChildLM(lm); clm.fillArea(lm); 1.35 +0 -1 xml-fop/src/java/org/apache/fop/fo/FObjMixed.java Index: FObjMixed.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/FObjMixed.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 --- FObjMixed.java22 Aug 2004 01:56:33 - 1.34 +++ FObjMixed.java26 Aug 2004 20:58:30 - 1.35 @@ -75,7 +75,6 @@ if (getChildNodes() != null) { InlineStackingLayoutManager lm; lm = new InlineStackingLayoutManager(this); -lm.setLMiter(new LMiter(lm, getChildNodes())); list.add(lm); } } 1.10 +27 -0 xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java Index: LayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- LayoutManager.java13 Jul 2004 00:16:22 - 1.9 +++ LayoutManager.java26 Aug 2004 20:58:30 - 1.10 @@ -18,6 +18,7 @@ package org.apache.fop.layoutmgr; +import java.util.List; import java.util.Map; import org.apache.fop.fo.flow.Marker; @@ -217,5 +218,31 @@ * @return the layout manaager of the retrieved marker if any */ Marker retrieveMarker(String name, int pos, int boundary); + +/** + * Load next child LMs, up to child LM index pos + * @param pos index up to which child LMs are requested + * @return if requested index does exist + */ +boolean preLoadNext(int pos); + +/** + * @return the list of child LMs + */ +List getChildLMs(); + +/** + * Add the LM in the argument to the list of child LMs; + * set this LM as the parent; + * initialize the LM. + * @param lm the LM to be added + */ +void addChildLM(LayoutManager lm); + +/** + * Add the LMs in the argument to the list of child LMs; + * @param newLMs the list of LMs to be added + */ +void addChildLMs(List newLMs); } 1.20 +76 -6 xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Index: AbstractLayoutManager.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v
cvs commit: xml-fop/src/documentation/content/xdocs/design configuration.xml
spepping2004/08/05 13:16:50 Added: src/documentation/content/xdocs/design configuration.xml Log: First version Revision ChangesPath 1.1 xml-fop/src/documentation/content/xdocs/design/configuration.xml Index: configuration.xml === ?xml version=1.0 standalone=no? !-- Copyright 1999-2004 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: configuration.xml,v 1.1 2004/08/05 20:16:50 spepping Exp $ -- !DOCTYPE document PUBLIC -//APACHE//DTD Documentation V1.1//EN http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-forrest/src/core/context/resources/schema/dtd/document-v12.dtd; [ !ENTITY lsquo #x2018; !ENTITY rsquo #x2019; !ENTITY ldquo #x201C; !ENTITY rdquo #x201D; ] document header titleFOP: Configuration and Logging/title version$Revision: 1.1 $/version /header body section id=general titleConfiguration File Basics/title pThe FOP configuration file is an XML file containing a variety of settings that are useful for controlling FOP's behavior, and for helping it find resources that you wish it to use./p pThe easiest way to get started using a FOP configuration file is to copy the sample found at code{fop-dir}/conf/fop.xconf/code to a location of your choice, and then to edit it according to your needs. It contains templates for the various configuration options, most of which are commented out. Remove the comments and change the settings for entries that you wish to use. Be sure to follow any instructions, including comments which specify the value range. Also, since the configuration file is XML, be sure to keep it well-formed./p /section section id=general-available titleMaking Configuration Available to FOP/title pAfter creating your configuration file, you must tell FOP how to find it./p section id=command-line titleFrom the Command Line/title pWhen you run FOP from the command-line, use the ldquo;code-c/coderdquo; command-line option with the path to the configuration file as the option value./p /section section id=embedded-file titleA Configuration File in an Embedded Application/title pFOP uses the Avalon framework configuration package codeorg.apache.avalon.framework.configuration/code. For detailed information, see the documentation of the package./p pIf you want to use a user configuration file with your embedded program, you need to build an Avalon configuration object from it, and register that with the user agent:/p sourceFOUserAgent foUserAgent; XMLReader parser; DefaultConfigurationBuilder configBuilder; File userConfigFile; Configuration userConfig; configBuilder = new DefaultConfigurationBuilder(parser); userConfigFile = new File(YourConfigFile.xml); userConfig = configBuilder.buildFromFile(userConfigFile); foUserAgent.setUserConfig(userConfig); /source pYou can find example code in FOP's codeapps.CommandLine/code class, method codecreateUserConfig/code./p /section section id=embedded-build titleProgrammatically Building the Configuration/title pYou can also build the configuration object programmatically, instead of building it from an external file. Make sure that the configuration object is equivalent to a configuration object that would be obtained from a correct configuration file. Register the configuration object with the user agent as described above./p /section /section section id=config-overview titleThe Configuration File/title pThe top-level element is arbitrary. You may give it any name that is useful for you, e.g. codelt;fop-configuration version=2/code./p pInside the top-level element the configuration may contain three sections: codeuserAgent/code, coderenderers/code, and codehyphenation/code. At the moment of this writing the codeuserAgent/code and codehyphenation/code sections are not used by FOP./p pThe coderenderers/code section has subsections called coderenderer/code. There may be one subsection for each type
cvs commit: xml-fop/src/documentation/content/xdocs/DnI - New directory
spepping2004/08/01 12:41:48 xml-fop/src/documentation/content/xdocs/DnI - New directory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/examples/embedding/java/embedding ExampleFO2PDFUsingSAX.java
spepping2004/07/18 12:55:17 Modified:examples/embedding build.xml Added: examples/embedding/java/embedding ExampleFO2PDFUsingSAX.java Log: Added alternative example for FO to PDF, using javax.xml.parsers Revision ChangesPath 1.7 +9 -0 xml-fop/examples/embedding/build.xml Index: build.xml === RCS file: /home/cvs/xml-fop/examples/embedding/build.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- build.xml 7 Jul 2004 22:15:10 - 1.6 +++ build.xml 18 Jul 2004 19:55:17 - 1.7 @@ -138,6 +138,15 @@ /classpath /java /target + target name=example8 depends=compile description=Runs the FO to PDF example using a SAXParser + echo message=Running the FO to PDF example using a SAXParser/ + java classname=${name}.ExampleFO2PDFUsingSAX fork=yes + classpath + path refid=project.class.path/ + pathelement location=${build.dest}/ + /classpath + /java + /target !-- === -- !-- Clean targets -- !-- === -- 1.1 xml-fop/examples/embedding/java/embedding/ExampleFO2PDFUsingSAX.java Index: ExampleFO2PDFUsingSAX.java === /* * Copyright 1999-2004 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: ExampleFO2PDFUsingSAX.java,v 1.1 2004/07/18 19:55:17 spepping Exp $ */ package embedding; // Java import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; //JAXP import javax.xml.parsers.SAXParserFactory; import javax.xml.parsers.FactoryConfigurationError; import javax.xml.parsers.SAXParser; import javax.xml.parsers.ParserConfigurationException; //SAX import org.xml.sax.helpers.DefaultHandler; import org.xml.sax.SAXException; // FOP import org.apache.fop.apps.Driver; import org.apache.fop.apps.FOPException; /** * This class demonstrates the conversion of an FO file to PDF using FOP. * It uses a SAXParser with FOP as the DefaultHandler */ public class ExampleFO2PDFUsingSAX { /** * Converts an FO file to a PDF file using FOP * @param fo the FO file * @param pdf the target PDF file * @throws FactoryConfigurationError * @throws ParserConfigurationException * @throws SAXException * @throws IOException In case of an I/O problem * @throws FOPException In case of a FOP problem */ public void convertFO2PDF(File fo, File pdf) throws FactoryConfigurationError, ParserConfigurationException, FOPException, SAXException, IOException { OutputStream out = null; try { // Construct driver and setup output format Driver driver = new Driver(); driver.setRenderer(Driver.RENDER_PDF); // Setup output stream. Note: Using BufferedOutputStream // for performance reasons (helpful with FileOutputStreams). out = new FileOutputStream(pdf); out = new BufferedOutputStream(out); driver.setOutputStream(out); // Setup SAX parser // throws FactoryConfigurationError SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setNamespaceAware(true); // throws ParserConfigurationException SAXParser parser = factory.newSAXParser(); // Obtain FOP's DefaultHandler // throws FOPException DefaultHandler dh = driver.getDefaultHandler(); // Start parsing and FOP processing // throws SAXException, IOException parser.parse(fo, dh); } finally { out.close(); } } /** * Main method. * @param args
cvs commit: xml-fop/conf fop.xconf
spepping2004/07/09 13:07:47 Modified:conf fop.xconf Log: Reviewed the Mime types Revision ChangesPath 1.4 +99 -89xml-fop/conf/fop.xconf Index: fop.xconf === RCS file: /home/cvs/xml-fop/conf/fop.xconf,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- fop.xconf 14 Dec 2002 15:35:28 - 1.3 +++ fop.xconf 9 Jul 2004 20:07:47 - 1.4 @@ -14,95 +14,105 @@ !-- NOTE: This is the version of the configuration -- fop version=1.0 -userAgent - base url=.// - !-- pixel to millimeter to specify dpi, 72dpi -- - pixelToMillimeter value=0.3528/ -/userAgent - -!-- Information for specific renderers -- -!-- Uses renderer mime type for renderers -- -renderers -renderer mime=application/pdf - filterList - !-- provides compression using zlib flate (default is on)-- - valueflate/value - - !-- encodes binary data into printable ascii characters (default off) - This provides about a 4:5 expansion of data size -- - !-- valueascii-85/value -- - - !-- encodes binary data with hex representation (default off) - This filter is not recommended as it doubles the data size -- - !-- valueascii-hex/value -- - /filterList - -fonts - !-- embedded fonts -- -!-- - this information must exactly match the font specified - in the fo file otherwise it will use a default font. - ie. - fo:inline font-family=Arial font-weight=bold font-style=normal - Arial-normal-normal font - /fo:inline - - for the font triplet specified by: - font-triplet name=Arial style=normal weight=bold/ - - If you do not want to embed the font in the pdf document - then do not include the embed-url attribute. - The font will be needed where the document is viewed - for it to be displayed properly. - - possible styles: normal | italic | oblique | backslant - possible weights: normal | bold | 100 | 200 | 300 | 400 -| 500 | 600 | 700 | 800 | 900 - (normal = 400, bold = 700) - -- - -!-- - font metrics-url=arial.xml kerning=yes embed-url=arial.ttf -font-triplet name=Arial style=normal weight=normal/ -font-triplet name=ArialMT style=normal weight=normal/ - /font - font metrics-url=arialb.xml kerning=yes embed-url=arialb.ttf -font-triplet name=Arial style=normal weight=bold/ -font-triplet name=ArialMT style=normal weight=bold/ - /font --- -/fonts -xmlHandler mime=text/svg+xml -/xmlHandler -/renderer -renderer mime=application/ps -xmlHandler mime=image/svg+xml -/xmlHandler -/renderer -renderer mime=pcl - -/renderer -renderer mime=mif - -/renderer -renderer mime=text/svg+xml -format type=paginated/ -link value=true/ -strokeText value=false/ -/renderer -renderer mime=awt - -/renderer -renderer mime=text/xml - -/renderer -renderer mime=application/rtf - -/renderer -renderer mime=text/text -pageSize columns=80/ -/renderer -/renderers + userAgent +base url=.// +!-- pixel to millimeter to specify dpi, 72dpi -- +pixelToMillimeter value=0.3528/ + /userAgent + + !-- Information for specific renderers -- + !-- Uses renderer mime type for renderers -- + renderers +renderer mime=application/pdf + filterList +!-- provides compression using zlib flate (default is on) -- +valueflate/value + +!-- encodes binary data into printable ascii characters (default off) + This provides about a 4:5 expansion of data size -- +!-- valueascii-85/value -- + +!-- encodes binary data with hex representation (default off) + This filter is not recommended as it doubles the data size -- +!-- valueascii-hex/value -- + /filterList + + fonts +!-- embedded fonts -- +!-- +This information must exactly match the font specified +in the fo file. Otherwise it will use a default font. + +For example, +fo:inline font-family=Arial font-weight=bold font-style=normal +Arial-normal-normal font +/fo:inline +for the font triplet specified by: +font-triplet name=Arial style=normal weight=bold/ + +If you do not want to embed the font in the pdf document +then do not include the embed-url attribute. +The font will be needed where the document is viewed +for it to be displayed properly. + +possible styles: normal | italic | oblique | backslant +possible weights: normal | bold | 100 | 200 | 300 | 400 + | 500 | 600 | 700 | 800