Re: cvs commit: xml-fop/src/java/org/apache/fop/datastructs Tree.java
Peter, I think it's a bit premature to apply the 2.0 licence already. The board has announced additional information on how the licence should be applied. This is not a veto, I just want to avoid you having to do the whole thing twice. Another thing: Please pay attention to the copyright years. You have to take them over from the old licence. On 27.01.2004 00:07:11 pbwest wrote: pbwest 2004/01/26 15:07:11 Modified:src/java/org/apache/fop/datastructs Tag: FOP_0-20-0_Alt-Design Tree.java Log: Removed references to modCount, used for ConcurrentModificationException detection. Removed references to the setting of the containing Tree instance in Nodes. Updated license to 2.0. Revision ChangesPath No revision No revision 1.1.2.2 +16 -106 xml-fop/src/java/org/apache/fop/datastructs/Attic/Tree.java Index: Tree.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datastructs/Attic/Tree.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- Tree.java 5 Jul 2003 19:06:35 - 1.1.2.1 +++ Tree.java 26 Jan 2004 23:07:11 - 1.1.2.2 @@ -1,55 +1,19 @@ /* + Copyright 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$ - * - * - * - * The Apache Software License, Version 1.1 - * - * - * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - * snip/ Jeremias Maerki
AW: RTF: white-space-treatment and linefeed-treatment
What are the difficulties for nested blocks? Maybe difficulties is the wrong word. Just a thing i have to care for. If i do the processing of FOs in endBlock, i have to suppress the processing within nested blocks. Or the nested blocks will be processed twice. Kind regards Peter Herweg -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Auftrag von J.Pietschmann Gesendet: Monday, January 26, 2004 8:58 PM An: [EMAIL PROTECTED] Betreff: Re: RTF: white-space-treatment and linefeed-treatment Peter Herweg wrote: (2) I defer the processing of all inline-generating, text-containing FOs, and process them in RtfHandler.endBlock. I'd say start with this option, although I'm starting to believe we could and should move whitespace processing to before the invocation of the structure renderer's character event call. You still have to delay some output because space before/after a line break must be stripped for many settings. What are the difficulties for nested blocks? J.Pietschmann
Re: cvs commit: xml-fop/src/java/org/apache/fop/datastructs Tree.java
Jeremias Maerki wrote: Peter, I think it's a bit premature to apply the 2.0 licence already. The board has announced additional information on how the licence should be applied. This is not a veto, I just want to avoid you having to do the whole thing twice. Another thing: Please pay attention to the copyright years. You have to take them over from the old licence. Oops. Thanks Jeremias. There is information on the web site about how to use the license, but I daresay it will need to be refined. I happened to be in the middle of a number of changes, so I went with the new license. Peter -- Peter B. West http://www.powerup.com.au/~pbwest/resume.html
RE: Unnesting properties and makers.
-Original Message- From: John Austin [mailto:[EMAIL PROTECTED] snip / So I copied that program and ran it on my RH 9 system. Hmmm... so you copied it with or without the cp-error ;) Got the following results. I am just quoting the results here: [EMAIL PROTECTED] foptest]$ java -classpath . x false method call 998 true method call 1001 false instanceof 3008 true instanceof 4119 [EMAIL PROTECTED] foptest]$ java -server -classpath . x false method call 1 true method call 0 false instanceof 0 true instanceof 4822 [EMAIL PROTECTED] foptest]$ java -server x false method call 1 true method call 0 false instanceof 0 true instanceof 4784 My guess is: with. Never mind, just need to swap the results then... H. You also wondering what to conclude, ay? (apart from -server being a real booster) Cheers, Andreas
cvs commit: xml-fop/src/java/org/apache/fop overview.html
pbwest 2004/01/26 15:21:05 Added: src/java/org/apache/fop Tag: FOP_0-20-0_Alt-Design overview.html Log: Revision ChangesPath No revision No revision 1.2.2.1 +3 -4 xml-fop/src/java/org/apache/fop/overview.html Index: overview.html === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/overview.html,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- overview.html 27 Apr 2003 18:19:49 - 1.2 +++ overview.html 26 Jan 2004 23:21:05 - 1.2.2.1 @@ -1,10 +1,9 @@ HTML TITLEFOP Overview/TITLE BODY -PFOP formats and renders XSL-FO input into a variety of output formats, -including PDF and PostScript./P +PFOP is an XSL formatter and renderer that works with an XSLT transformer to +produce PDF (and eventually other output formats) from XML documents./P -PTo more information, including general documentation, go to the A -href=http://xml.apache.org/fop; target=fop-homeFOP Home Page/A./P +PTo get an overview of the FOP process, begin with the class A HREF=org/apache/fop/apps/Driver.htmlorg.apache.fop.apps.Driver/A./P /BODY /HTML - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/datastructs Node.java
pbwest 2004/01/26 15:03:53 Modified:src/java/org/apache/fop/datastructs Tag: FOP_0-20-0_Alt-Design Node.java Log: Removed Tree reference from Node. The intention is to allow floating subtrees during Area tree construction. Previously, the containing Tree reference was used as the synchronization object. Now synchronization is effected on methods (instance sync). However, this leaves some constructors with dubvious synchronization. Updated license to 2.0. Revision ChangesPath No revision No revision 1.1.2.3 +239 -512 xml-fop/src/java/org/apache/fop/datastructs/Attic/Node.java Index: Node.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datastructs/Attic/Node.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- Node.java 5 Jan 2004 01:45:32 - 1.1.2.2 +++ Node.java 26 Jan 2004 23:03:53 - 1.1.2.3 @@ -1,68 +1,29 @@ /* + Copyright 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$ - * - * - * - * The Apache Software License, Version 1.1 - * - * - * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modifica- - * tion, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - *this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - *this list of conditions and the following disclaimer in the documentation - *and/or other materials provided with the distribution. - * - * 3. The end-user documentation included with the redistribution, if any, must - *include the following acknowledgment: This product includes software - *developed by the Apache Software Foundation (http://www.apache.org/). - *Alternately, this acknowledgment may appear in the software itself, if - *and wherever such third-party acknowledgments normally appear. - * - * 4. The names FOP and Apache Software Foundation must not be used to - *endorse or promote products derived from this software without prior - *written permission. For written permission, please contact - *[EMAIL PROTECTED] - * - * 5. Products derived from this software may not be called Apache, nor may - *Apache appear in their name, without prior written permission of the - *Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- - * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * This software consists of voluntary contributions made by many individuals - * on behalf of the Apache Software Foundation and was originally created by - * James Tauber [EMAIL PROTECTED]. For more information on the Apache - * Software Foundation, please see http://www.apache.org/. - * - * */ package org.apache.fop.datastructs; import java.util.ArrayList; -import java.util.ConcurrentModificationException; import java.util.NoSuchElementException; import java.util.Iterator; import java.util.ListIterator; /* - * @author a href=mailto:[EMAIL PROTECTED]Peter B. West/a - * @version
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfStringConverter.java
pherweg 2004/01/27 08:58:59 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfStringConverter.java Log: Submitted by Lucas Bruand to JFOR: escape all characters 127 instead of 255 Revision ChangesPath 1.2 +2 -2 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java Index: RtfStringConverter.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- RtfStringConverter.java 4 Nov 2003 23:59:11 - 1.1 +++ RtfStringConverter.java 27 Jan 2004 16:58:58 - 1.2 @@ -137,7 +137,7 @@ w.write('\\'); w.write(replacement); w.write(' '); -} else if (c.charValue() 255) { +} else if (c.charValue() 127) { // write unicode representation - contributed by Michel Jacobson // [EMAIL PROTECTED] w.write(\\u); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: RTF: white-space-treatment and linefeed-treatment
Peter Herweg wrote: Maybe difficulties is the wrong word. Just a thing i have to care for. If i do the processing of FOs in endBlock, i have to suppress the processing within nested blocks. Or the nested blocks will be processed twice. I think you can flush the queue each time a nested block starts and each time a block ends. The start of a new block forces a new line, so you can finish the current line, including whitespace processing. J.Pietschmann
RE: AW: RTF: white-space-treatment and linefeed-treatment
I think you can flush the queue each time a nested block starts and each time a block ends. I have no queue to flush. All i do is ignoring all event handler functions until endBlock is called for a not-nested Block. Then i iterate recursively through its children an call all appropriate event handlers. For this purpose i have implemented a reference counter. Eachtime startBlock is entered the counter is incremented. Eachtime endBlock is entered the counter is decremented. So when the reference counter reachs 0, a not-nested block is finished and i can process all deferred FOs. Works quite good. Kind regards Peter Herweg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of J.Pietschmann Sent: Tuesday, January 27, 2004 9:16 PM To: [EMAIL PROTECTED] Subject: Re: AW: RTF: white-space-treatment and linefeed-treatment Peter Herweg wrote: Maybe difficulties is the wrong word. Just a thing i have to care for. If i do the processing of FOs in endBlock, i have to suppress the processing within nested blocks. Or the nested blocks will be processed twice. I think you can flush the queue each time a nested block starts and each time a block ends. The start of a new block forces a new line, so you can finish the current line, including whitespace processing. J.Pietschmann
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfTextrun.java RtfParagraph.java
pherweg 2004/01/27 09:33:27 Modified:src/java/org/apache/fop/render/rtf/rtflib/rtfdoc RtfTextrun.java RtfParagraph.java Log: Removed call of JFOR's WhiteSpaceCollapser; now this is done by FOP Revision ChangesPath 1.9 +4 -11 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java Index: RtfTextrun.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- RtfTextrun.java 10 Jan 2004 19:43:58 - 1.8 +++ RtfTextrun.java 27 Jan 2004 17:33:27 - 1.9 @@ -228,19 +228,12 @@ */ protected void writeRtfContent() throws IOException { /** - *TODO: The textrun's children are iterated threetimes: - * 1. In WhitespaceCollapser - * 2. To determine the last RtfParagraphBreak - * 3. To write the children + *TODO: The textrun's children are iterated twice: + * 1. To determine the last RtfParagraphBreak + * 2. To write the children * Maybe this can be done more efficient. */ - -if (attrib != null attrib.isSet(WhiteSpaceFalse)) { -attrib.unset(WhiteSpaceFalse); -} else { -new WhitespaceCollapser(this); -} - + //determine, if this RtfTextrun is the last child of its parent boolean bLast = false; for (Iterator it = parent.getChildren().iterator(); it.hasNext();) { 1.3 +1 -8 xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java Index: RtfParagraph.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraph.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- RtfParagraph.java 8 Nov 2003 19:58:03 - 1.2 +++ RtfParagraph.java 27 Jan 2004 17:33:27 - 1.3 @@ -136,13 +136,6 @@ * @throws IOException for I/O problems */ protected void writeRtfPrefix() throws IOException { -// collapse whitespace before writing out -// TODO could be made configurable -if (attrib != null attrib.isSet(WhiteSpaceFalse)) { -attrib.unset(WhiteSpaceFalse); -} else { -new WhitespaceCollapser(this); -} //Reset paragraph properties if needed if (resetProperties) { - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/render/rtf RTFHandler.java
pherweg 2004/01/27 08:51:29 Modified:src/java/org/apache/fop/render/rtf RTFHandler.java Log: added support for white-space-treatment and linefeed-treatment by deferring the processing of some FOs until execution of endBlock Revision ChangesPath 1.15 +283 -1xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java Index: RTFHandler.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/rtf/RTFHandler.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- RTFHandler.java 24 Jan 2004 16:09:48 - 1.14 +++ RTFHandler.java 27 Jan 2004 16:51:29 - 1.15 @@ -54,12 +54,14 @@ import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; +import java.util.Iterator; import org.apache.avalon.framework.logger.ConsoleLogger; import org.apache.avalon.framework.logger.Logger; import org.apache.fop.apps.FOPException; import org.apache.fop.fo.EnumProperty; import org.apache.fop.fo.FOInputHandler; +import org.apache.fop.fo.FObj; import org.apache.fop.datatypes.FixedLength; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; @@ -71,6 +73,7 @@ import org.apache.fop.fo.flow.Leader; import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; +import org.apache.fop.fo.flow.ListItemLabel; import org.apache.fop.fo.flow.PageNumber; import org.apache.fop.fo.flow.Table; import org.apache.fop.fo.flow.TableColumn; @@ -82,6 +85,7 @@ import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.SimplePageMaster; import org.apache.fop.fo.Constants; +import org.apache.fop.fo.FOText; import org.apache.fop.fo.Property; import org.apache.fop.fo.LengthProperty; import org.apache.fop.fo.StringProperty; @@ -129,6 +133,12 @@ private final Logger log = new ConsoleLogger(); private RtfSection sect; private RtfDocumentArea docArea; +private int iNestCount; +private boolean bDefer; //true, if each called handler shall be + //processed at later time. +private boolean bDeferredExecution; //true, if currently called handler was not + //called while SAX parsing, but was called + //by invokeDeferredEvent. private boolean bPrevHeaderSpecified = false;//true, if there has been a //header in any page-sequence private boolean bPrevFooterSpecified = false;//true, if there has been a @@ -150,6 +160,9 @@ public RTFHandler(Document doc, OutputStream os) { super(doc); this.os = os; +bDefer = false; +bDeferredExecution = false; +iNestCount=0; FontSetup.setup(doc, null); log.warn(ALPHA_WARNING); } @@ -185,6 +198,10 @@ */ public void startPageSequence(PageSequence pageSeq) { try { +if (bDefer) { +return; +} + sect = docArea.newSection(); //read page size and margins, if specified @@ -218,6 +235,10 @@ * @see org.apache.fop.fo.FOInputHandler#endPageSequence(PageSequence) */ public void endPageSequence(PageSequence pageSeq) throws FOPException { +if (bDefer) { +return; +} + builderContext.popContainer(); } @@ -225,6 +246,10 @@ * @see org.apache.fop.fo.FOInputHandler#startFlow(Flow) */ public void startFlow(Flow fl) { +if (bDefer) { +return; +} + try { if (fl.getFlowName().equals(xsl-region-body)) { // if there is no header in current page-sequence but there has been @@ -300,6 +325,10 @@ * @see org.apache.fop.fo.FOInputHandler#endFlow(Flow) */ public void endFlow(Flow fl) { +if (bDefer) { +return; +} + try { if (fl.getFlowName().equals(xsl-region-body)) { //just do nothing @@ -318,6 +347,19 @@ * @see org.apache.fop.fo.FOInputHandler#startBlock(Block) */ public void startBlock(Block bl) { +++iNestCount; + +if (!bDeferredExecution) { +//If startBlock was called while SAX parsing, defer processing of this +//FO and all its elements until endBlock. This has to be done, because +//attributes (for example while-space-treatment, linefeed-treatment) +//are not available until endBlock. +bDefer = true; +} +if (bDefer) { +return; +
DO NOT REPLY [Bug 26469] New: - Text without spaces is not wrapped
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26469. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26469 Text without spaces is not wrapped Summary: Text without spaces is not wrapped Product: Fop Version: 0.20.5 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Major Priority: Other Component: pdf renderer AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] If you have a long text without spaces (e.g. a hyperlink) that exceeds the PDF page width, this text is not wrapped. So any information exceeding the PDF page width is not displayed.
Synchronization questions
I've been hacking the tree methods in Node recently, triggered by the need to construct multiple subtrees during area tree construction, cobbling them together as necessary. In the original version, I was able to synchronize on the Node's containing Tree instance, but that is no longer feasible, as Nodes may be free-floating. My first change was to synchronize the methods which had previously been synchronized on the Tree, but I realized that such synchronization of methods in inner classes probably only synchronized on the actual inner class instance, not on the containing class instance. Does anyone have any knowledge of this? It also occurred to me that optional synchronization might be a good idea, allowing a common synchronization object to be passed to the Node constructor. An alternative was to allow optional synchronization, but to synchronize on the affected Node object. On the construction of any particular Node, a boolean can be passed indicating the need for synchronization. To implement this, I use the Node or the containing Node (in the case of inner classes) as the synchronization object. So iteration operations on the Tree (like those of PreOrder or PrecedingSibling) and bulk operations (like copySubTree) end up synchronizing on each Node during the traversal. This has the advantage that operations which occur relative to any given Node (like those of PrecedingSibling) can occur in parallel with activities in other parts of the tree. The disadvantages include the large number of possible synchronizations, and an unknown incremental risk of deadlock. Does anyone have experience with such issues? Peter -- Peter B. West http://www.powerup.com.au/~pbwest/resume.html
cvs commit: xml-fop/src/java/org/apache/fop/area AreaTree.java Area.java
pbwest 2004/01/27 22:16:31 Added: src/java/org/apache/fop/area Tag: FOP_0-20-0_Alt-Design AreaTree.java Area.java Log: Stubs for these classes. Revision ChangesPath No revision No revision 1.7.2.1 +26 -277 xml-fop/src/java/org/apache/fop/area/AreaTree.java Index: AreaTree.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/AreaTree.java,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -r1.7 -r1.7.2.1 --- AreaTree.java 20 Dec 2003 06:53:22 - 1.7 +++ AreaTree.java 28 Jan 2004 06:16:31 - 1.7.2.1 @@ -1,290 +1,39 @@ /* + Copyright 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. + + * Created on 26/01/2004 * $Id$ - * - *The Apache Software License, Version 1.1 - * - * - * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modifica- - * tion, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - *this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, - *this list of conditions and the following disclaimer in the documentation - *and/or other materials provided with the distribution. - * - * 3. The end-user documentation included with the redistribution, if any, must - *include the following acknowledgment: This product includes software - *developed by the Apache Software Foundation (http://www.apache.org/). - *Alternately, this acknowledgment may appear in the software itself, if - *and wherever such third-party acknowledgments normally appear. - * - * 4. The names FOP and Apache Software Foundation must not be used to - *endorse or promote products derived from this software without prior - *written permission. For written permission, please contact - *[EMAIL PROTECTED] - * - * 5. Products derived from this software may not be called Apache, nor may - *Apache appear in their name, without prior written permission of the - *Apache Software Foundation. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- - * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * - * This software consists of voluntary contributions made by many individuals - * on behalf of the Apache Software Foundation and was originally created by - * James Tauber [EMAIL PROTECTED]. For more information on the Apache - * Software Foundation, please see http://www.apache.org/. */ package org.apache.fop.area; -import org.apache.fop.area.extensions.BookmarkData; -import org.apache.fop.fo.extensions.Outline; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.HashSet; -import java.util.Iterator; +import org.apache.fop.datastructs.Tree; /** - * Area tree for formatting objects. - * - * Concepts: - * The area tree is to be as small as possible. With minimal classes - * and data to fully represent an area tree for formatting objects. - * The area tree needs to be simple to render
cvs commit: xml-fop/src/java/org/apache/fop/datastructs Node.java
pbwest 2004/01/27 22:19:56 Modified:src/java/org/apache/fop/datastructs Tag: FOP_0-20-0_Alt-Design Node.java Log: Added optional synchronization. Revision ChangesPath No revision No revision 1.1.2.4 +357 -190 xml-fop/src/java/org/apache/fop/datastructs/Attic/Node.java Index: Node.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datastructs/Attic/Node.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -r1.1.2.3 -r1.1.2.4 --- Node.java 26 Jan 2004 23:03:53 - 1.1.2.3 +++ Node.java 28 Jan 2004 06:19:56 - 1.1.2.4 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. @@ -59,135 +59,157 @@ public class Node implements Cloneable { +/** The parent of this node. If null, this is the root node. */ protected Node parent; +/** An array of the children of this node. */ protected ArrayList children; // ArrayList of Node /** Creation size of the ichildren/i ttArrayList/tt. */ private static final int FAMILYSIZE = 4; + +/** Constant codeboolean/code for synchronization argument. */ +public static final boolean SYNCHRONIZE = true; +/** Constant codeboolean/code for synchronization argument. */ +public static final boolean DONT_SYNCHRONIZE = ! SYNCHRONIZE; + +public final boolean synchronize; + +/** + * This immutable empty array is provided as a convenient class-level + * synchronization object for circumstances where such synchronization + * is required. + */ +public static final boolean[] sync = new boolean[0]; /** * No argument constructor. - * - * Assumes that this node is the root, and so will throw a - * ttTreeException/tt when the root node in the enclosing - * ttTree/tt object is non-null. + * Assumes that this node is the root of a new tree. */ public Node() { +synchronize = false; parent = null; } /** - * @param parent Node which is the parent of this Node. if this is - * null, the generated Node is assumed to be the root - * node. If the Tree root node is already set, throws - * a ttTreeException/tt. - * @param index int index of child in parent. + * Constructor with specific synchronization flag. + * @param synchronize flag for synchronization + */ +public Node(boolean synchronize) { +this.synchronize = synchronize; +parent = null; +} + +/** + * Adds a codeNode/code as a child at a given index position among + * its parent's children. + * @param parent of this Node + * @param index of child in parent. If the parent reference + * is codenull/code, an IndexOutOfBoundsException is thrown. + * @param synchronize if true, synchronizes on the parent. */ -public Node(Node parent, int index) -throws IndexOutOfBoundsException { +public Node(Node parent, int index, boolean synchronize) +throws IndexOutOfBoundsException { if (parent == null) { -this.parent = null; +throw new IndexOutOfBoundsException(Null parent); } else { +this.synchronize = synchronize; this.parent = parent; -// connect me to my parent parent.addChild(index, this); } } - + /** - * @param parent Node which is the parent of this Node. if this is + * Adds a codeNode/code as a child of the given parent. + * @param parent of this Node. if this is * null, the generated Node is assumed to be the root * node. + * @param synchronize if true, synchronizes on the parent. */ -public Node(Node parent) +public Node(Node parent, boolean synchronize) throws IndexOutOfBoundsException { -if (parent == null) { -this.parent = null; -} -else { -this.parent = parent; -// connect me to my parent +this.synchronize = synchronize; +this.parent = parent; +if (parent != null) { parent.addChild(this); } } /** - * Appends a child ttNode/tt to this node. Synchronized on the - * containing ttTree/tt object. - * - * Calls the imodified/i method of the containing
cvs commit: xml-fop/src/java/org/apache/fop/datastructs Tree.java
pbwest 2004/01/27 22:21:12 Modified:src/java/org/apache/fop/datastructs Tag: FOP_0-20-0_Alt-Design Tree.java Log: Fixed copyright dates Revision ChangesPath No revision No revision 1.1.2.3 +3 -3 xml-fop/src/java/org/apache/fop/datastructs/Attic/Tree.java Index: Tree.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datastructs/Attic/Tree.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- Tree.java 26 Jan 2004 23:07:11 - 1.1.2.2 +++ Tree.java 28 Jan 2004 06:21:12 - 1.1.2.3 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/fo FOTree.java FoRoot.java
pbwest 2004/01/27 22:24:30 Modified:src/java/org/apache/fop/fo/pagination Tag: FOP_0-20-0_Alt-Design PageSequenceMaster.java FoPageSequenceMaster.java FoLayoutMasterSet.java src/java/org/apache/fop/datastructs Tag: FOP_0-20-0_Alt-Design TNodeTest.java src/java/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FOTree.java FoRoot.java Log: Fixed copyright dates Revision ChangesPath No revision No revision 1.1.2.3 +1 -1 xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java Index: PageSequenceMaster.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- PageSequenceMaster.java 27 Jan 2004 02:07:49 - 1.1.2.2 +++ PageSequenceMaster.java 28 Jan 2004 06:24:30 - 1.1.2.3 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. 1.1.2.8 +3 -3 xml-fop/src/java/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java Index: FoPageSequenceMaster.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Attic/FoPageSequenceMaster.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- FoPageSequenceMaster.java 27 Jan 2004 02:06:53 - 1.1.2.7 +++ FoPageSequenceMaster.java 28 Jan 2004 06:24:30 - 1.1.2.8 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. 1.1.2.8 +4 -4 xml-fop/src/java/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java Index: FoLayoutMasterSet.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Attic/FoLayoutMasterSet.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -r1.1.2.7 -r1.1.2.8 --- FoLayoutMasterSet.java27 Jan 2004 02:04:03 - 1.1.2.7 +++ FoLayoutMasterSet.java28 Jan 2004 06:24:30 - 1.1.2.8 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. No revision No revision 1.1.2.3 +2 -2 xml-fop/src/java/org/apache/fop/datastructs/Attic/TNodeTest.java Index: TNodeTest.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datastructs/Attic/TNodeTest.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- TNodeTest.java26 Jan 2004 23:20:18 - 1.1.2.2 +++ TNodeTest.java28 Jan 2004 06:24:30 - 1.1.2.3 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. No revision No revision 1.1.2.6 +4 -4 xml-fop/src/java/org/apache/fop/fo/Attic/FOTree.java Index: FOTree.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Attic/FOTree.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- FOTree.java 27 Jan 2004 02:01:17 - 1.1.2.5 +++ FOTree.java 28 Jan 2004 06:24:30 - 1.1.2.6 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. 1.1.2.10 +4 -4 xml-fop/src/java/org/apache/fop/fo/Attic/FoRoot.java Index: FoRoot.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/Attic/FoRoot.java,v retrieving revision
cvs commit: xml-fop/src/java/org/apache/fop/fo FONode.java
pbwest 2004/01/27 22:25:32 Modified:src/java/org/apache/fop/fo Tag: FOP_0-20-0_Alt-Design FONode.java Log: Fixed copyright dates Revision ChangesPath No revision No revision 1.2.2.13 +2 -2 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.2.2.12 retrieving revision 1.2.2.13 diff -u -r1.2.2.12 -r1.2.2.13 --- FONode.java 27 Jan 2004 01:17:21 - 1.2.2.12 +++ FONode.java 28 Jan 2004 06:25:32 - 1.2.2.13 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. @@ -209,7 +209,7 @@ int stateFlags, int[] sparsePropsMap, int[] sparseIndices) throws TreeException, FOPException, PropertyException { -super(parent); +super(parent, Node.SYNCHRONIZE); this.foTree = foTree; this.type = type; this.stateFlags = stateFlags; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java/org/apache/fop/datastructs TNode.java
pbwest 2004/01/27 22:26:40 Modified:src/java/org/apache/fop/datastructs Tag: FOP_0-20-0_Alt-Design TNode.java Log: Fixed copyright dates. Synchronized with changes to Node. Revision ChangesPath No revision No revision 1.1.2.3 +6 -6 xml-fop/src/java/org/apache/fop/datastructs/Attic/TNode.java Index: TNode.java === RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/datastructs/Attic/TNode.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -r1.1.2.2 -r1.1.2.3 --- TNode.java26 Jan 2004 23:19:06 - 1.1.2.2 +++ TNode.java28 Jan 2004 06:26:40 - 1.1.2.3 @@ -1,5 +1,5 @@ /* - Copyright 2004 The Apache Software Foundation. + Copyright 2002-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. @@ -34,11 +34,11 @@ } public TNode(Tree tree, TNode parent, int index) { -super(parent, index); +super(parent, index, Node.SYNCHRONIZE); } public TNode(TNode parent) { -super(parent); +super(parent, Node.SYNCHRONIZE); } /** @@ -49,7 +49,7 @@ */ public TNode(TNode parent, Object content) { -super(parent); +super(parent, Node.SYNCHRONIZE); this.content = content; } @@ -63,7 +63,7 @@ public TNode(TNode parent, int index, Object content) throws IndexOutOfBoundsException { -super(parent, index); +super(parent, index, Node.SYNCHRONIZE); this.content = content; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop Copyright_2.0_txt Copyright_1.1_txt Copyright_2.0_java Copyright_1.1_java
pbwest 2004/01/27 22:58:09 Added: .Tag: FOP_0-20-0_Alt-Design Copyright_2.0_txt Copyright_1.1_txt Copyright_2.0_java Copyright_1.1_java Log: Text of copyright notices. Revision ChangesPath No revision No revision 1.1.2.1 +15 -0 xml-fop/Attic/Copyright_2.0_txt 1.1.2.1 +36 -0 xml-fop/Attic/Copyright_1.1_txt 1.1.2.1 +15 -0 xml-fop/Attic/Copyright_2.0_java 1.1.2.1 +36 -0 xml-fop/Attic/Copyright_1.1_java - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: xml-fop/src/java overview.html
pbwest 2004/01/27 22:58:56 Removed: src/java Tag: FOP_0-20-0_Alt-Design overview.html Log: Moved to the correct location. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]