gmazza 2004/07/24 15:56:31 Modified: src/java/org/apache/fop/area AreaTreeHandler.java src/java/org/apache/fop/fo FONode.java FObj.java PropertySets.java RecursiveCharIterator.java src/java/org/apache/fop/fo/flow Block.java ListItemBody.java ListItemLabel.java Wrapper.java src/java/org/apache/fop/fo/pagination Declarations.java LayoutMasterSet.java PageSequenceMaster.java RepeatablePageMasterAlternatives.java StaticContent.java src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java AddLMVisitor.java src/java/org/apache/fop/render/rtf RTFHandler.java Log: moved FO term of a Node's child elements from "Children" to "ChildNodes" Revision Changes Path 1.2 +2 -2 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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- AreaTreeHandler.java 13 Jul 2004 00:16:22 -0000 1.1 +++ AreaTreeHandler.java 24 Jul 2004 22:56:30 -0000 1.2 @@ -437,7 +437,7 @@ // to the Title. InlineStackingLayoutManager lm; lm = new InlineStackingLayoutManager(foTitle); - lm.setLMiter(new LMiter(lm, foTitle.children.listIterator())); + lm.setLMiter(new LMiter(lm, foTitle.childNodes.listIterator())); lm.initialize(); // get breaks then add areas to title 1.30 +6 -6 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.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- FONode.java 24 Jul 2004 04:46:33 -0000 1.29 +++ FONode.java 24 Jul 2004 22:56:30 -0000 1.30 @@ -165,7 +165,7 @@ } /** - * @param child child node to be added to the children of this node + * @param child child node to be added to the childNodes of this node */ protected void addChildNode(FONode child) { } @@ -178,21 +178,21 @@ } /** - * Return an iterator over all the children of this FObj. + * Return an iterator over all the child nodes of this FObj. * @return A ListIterator. */ - public ListIterator getChildren() { + public ListIterator getChildNodes() { return null; } /** - * Return an iterator over the object's children starting + * Return an iterator over the object's child nodes starting * at the pased node. * @param childNode First node in the iterator - * @return A ListIterator or null if childNode isn't a child of + * @return A ListIterator or null if child node isn't a child of * this FObj. */ - public ListIterator getChildren(FONode childNode) { + public ListIterator getChildNodes(FONode childNode) { return null; } 1.51 +28 -29 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.50 retrieving revision 1.51 diff -u -r1.50 -r1.51 --- FObj.java 24 Jul 2004 04:46:33 -0000 1.50 +++ FObj.java 24 Jul 2004 22:56:30 -0000 1.51 @@ -47,8 +47,8 @@ /** Id of this fo element of null if no id. */ protected String id = null; - /** The children of this node. */ - public ArrayList children = null; + /** The immediate child nodes of this node. */ + public ArrayList childNodes = null; /** Markers added to this element. */ protected Map markers = null; @@ -139,7 +139,21 @@ return propertyList.get(propId); } - /** + /** + * @see org.apache.fop.fo.FONode#addChildNode(FONode) + */ + protected void addChildNode(FONode child) { + if (containsMarkers() && "fo:marker".equals(child.getName())) { + addMarker((Marker)child); + } else { + if (childNodes == null) { + childNodes = new ArrayList(); + } + childNodes.add(child); + } + } + + /** * Find the nearest parent, grandparent, etc. FONode that is also an FObj * @return FObj the nearest ancestor FONode that is an FObj */ @@ -251,20 +265,6 @@ } /** - * @see org.apache.fop.fo.FONode#addChildNode(FONode) - */ - protected void addChildNode(FONode child) { - if (containsMarkers() && "fo:marker".equals(child.getName())) { - addMarker((Marker)child); - } else { - if (children == null) { - children = new ArrayList(); - } - children.add(child); - } - } - - /** * Setup the id for this formatting object. * Most formatting objects can have an id that can be referenced. * This methods checks that the id isn't already used by another @@ -335,28 +335,27 @@ } /** - * Return an iterator over all the children of this FObj. - * @return A ListIterator. + * @see org.apache.fop.fo.FONode#getChildNodes() */ - public ListIterator getChildren() { - if (children != null) { - return children.listIterator(); + public ListIterator getChildNodes() { + if (childNodes != null) { + return childNodes.listIterator(); } return null; } /** - * Return an iterator over the object's children starting + * Return an iterator over the object's childNodes starting * at the pased node. * @param childNode First node in the iterator * @return A ListIterator or null if childNode isn't a child of * this FObj. */ public ListIterator getChildren(FONode childNode) { - if (children != null) { - int i = children.indexOf(childNode); + if (childNodes != null) { + int i = childNodes.indexOf(childNode); if (i >= 0) { - return children.listIterator(i); + return childNodes.listIterator(i); } } return null; @@ -371,9 +370,9 @@ */ public void addMarker(Marker marker) { String mcname = marker.getMarkerClassName(); - if (children != null) { - // check for empty children - for (Iterator iter = children.iterator(); iter.hasNext();) { + if (childNodes != null) { + // check for empty childNodes + for (Iterator iter = childNodes.iterator(); iter.hasNext();) { FONode node = (FONode)iter.next(); if (node instanceof FOText) { FOText text = (FOText)node; 1.6 +11 -11 xml-fop/src/java/org/apache/fop/fo/PropertySets.java Index: PropertySets.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/PropertySets.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PropertySets.java 27 Feb 2004 17:57:40 -0000 1.5 +++ PropertySets.java 24 Jul 2004 22:56:30 -0000 1.6 @@ -969,7 +969,7 @@ - // Merge the attributes from the children into the parent. + // Merge the attributes from the child nodes into the parent. for (boolean dirty = true; dirty; ) { dirty = false; for (int i = 1; i < elements.length; i++) { @@ -1017,7 +1017,7 @@ BitSet relevant = new BitSet(); BitSet valid = new BitSet(); int elementId; - ArrayList children; + ArrayList childNodes; Element(int elementId) { this.elementId = elementId; @@ -1043,14 +1043,14 @@ * Add a single fo element as a content child. */ public void addContent(int elementId) { - if (children == null) { - children = new ArrayList(); + if (childNodes == null) { + childNodes = new ArrayList(); } - children.add(elements[elementId]); + childNodes.add(elements[elementId]); } /** - * Add a set of fo elements as content children. + * Add a set of fo elements as content child nodes. */ public void addContent(BitSet elements) { for (int i = 0; i < elements.size(); i++) { @@ -1061,16 +1061,16 @@ } /** - * Merge the properties from the children into the set of valid + * Merge the properties from the child nodes into the set of valid * properties. Return true if at least one property could be added. */ public boolean merge() { - if (children == null) { + if (childNodes == null) { return false; } boolean dirty = false; - for (int i = 0; i < children.size(); i++) { - Element child = (Element) children.get(i); + for (int i = 0; i < childNodes.size(); i++) { + Element child = (Element) childNodes.get(i); BitSet childValid = child.valid; int n = childValid.length(); for (int j = 0; j < n; j++) { 1.4 +7 -7 xml-fop/src/java/org/apache/fop/fo/RecursiveCharIterator.java Index: RecursiveCharIterator.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/RecursiveCharIterator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RecursiveCharIterator.java 27 Feb 2004 17:57:40 -0000 1.3 +++ RecursiveCharIterator.java 24 Jul 2004 22:56:30 -0000 1.4 @@ -22,13 +22,13 @@ import java.util.NoSuchElementException; /** - * Kind of a super-iterator that iterates through children of an FONode, + * Kind of a super-iterator that iterates through child nodes of an FONode, * in turn managing character iterators for each of them. Caveat: Because this * class is itself a CharIterator, and manages a collection of CharIterators, it * is easy to get confused. */ public class RecursiveCharIterator extends AbstractCharIterator { - /** parent node for whose children this iterator iterates */ + /** parent node for whose child nodes this iterator iterates */ private FONode fobj; /** iterator for the child nodes */ private Iterator childIter = null; @@ -39,25 +39,25 @@ private CharIterator curCharIter = null; /** - * Constructor which creates an iterator for all children + * Constructor which creates an iterator for all child nodes * @param fobj FONode for which an iterator should be created */ public RecursiveCharIterator(FObj fobj) { // Set up first child iterator this.fobj = fobj; - this.childIter = fobj.getChildren(); + this.childIter = fobj.getChildNodes(); getNextCharIter(); } /** - * Constructor which creates an iterator for only some children + * Constructor which creates an iterator for only some child nodes * @param fobj FObj for which an iterator should be created * @param child FONode of the first child to include in iterator */ public RecursiveCharIterator(FObj fobj, FONode child) { // Set up first child iterator this.fobj = fobj; - this.childIter = fobj.getChildren(child); + this.childIter = fobj.getChildNodes(child); getNextCharIter(); } @@ -73,7 +73,7 @@ */ public Object clone() { RecursiveCharIterator ci = (RecursiveCharIterator) super.clone(); - ci.childIter = fobj.getChildren(ci.curChild); + ci.childIter = fobj.getChildNodes(ci.curChild); // Need to advance to the next child, else we get the same one!!! ci.childIter.next(); ci.curCharIter = (CharIterator) curCharIter.clone(); 1.22 +2 -2 xml-fop/src/java/org/apache/fop/fo/flow/Block.java Index: Block.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Block.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -r1.21 -r1.22 --- Block.java 24 Jul 2004 04:46:34 -0000 1.21 +++ Block.java 24 Jul 2004 22:56:30 -0000 1.22 @@ -220,13 +220,13 @@ */ public void addChildNode(FONode child) { // Handle whitespace based on values of properties - // Handle a sequence of inline-producing children in + // Handle a sequence of inline-producing child nodes in // one pass if (child instanceof FObj && ((FObj) child).generatesInlineAreas()) { if (firstInlineChild == null) { firstInlineChild = child; } - // lastInlineChild = children.size(); + // lastInlineChild = childNodes.size(); } else { // Handle whitespace in preceeding inline areas if any handleWhiteSpace(); 1.12 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/ListItemBody.java Index: ListItemBody.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListItemBody.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- ListItemBody.java 12 Jun 2004 23:18:52 -0000 1.11 +++ ListItemBody.java 24 Jul 2004 22:56:30 -0000 1.12 @@ -49,7 +49,7 @@ * For calculating the lineage - The fo:list-item-body formatting object * does not generate any areas. The fo:list-item-body formatting object * returns the sequence of areas created by concatenating the sequences - * of areas returned by each of the children of the fo:list-item-body. + * of areas returned by each of the child nodes of the fo:list-item-body. */ } 1.17 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java Index: ListItemLabel.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/ListItemLabel.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ListItemLabel.java 16 Jun 2004 00:27:26 -0000 1.16 +++ ListItemLabel.java 24 Jul 2004 22:56:30 -0000 1.17 @@ -61,7 +61,7 @@ * For calculating the lineage - The fo:list-item-label formatting object * does not generate any areas. The fo:list-item-label formatting object * returns the sequence of areas created by concatenating the sequences - * of areas returned by each of the children of the fo:list-item-label. + * of areas returned by each of the child nodes of the fo:list-item-label. */ } 1.7 +1 -1 xml-fop/src/java/org/apache/fop/fo/flow/Wrapper.java Index: Wrapper.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/flow/Wrapper.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- Wrapper.java 12 Jun 2004 23:18:52 -0000 1.6 +++ Wrapper.java 24 Jul 2004 22:56:30 -0000 1.7 @@ -26,7 +26,7 @@ /** * Implementation for fo:wrapper formatting object. * The wrapper object serves as - * a property holder for it's children objects. + * a property holder for its child node objects. * * Content: (#PCDATA|%inline;|%block;)* * Properties: id 1.11 +4 -4 xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java Index: Declarations.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/Declarations.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Declarations.java 16 Jun 2004 23:40:58 -0000 1.10 +++ Declarations.java 24 Jul 2004 22:56:31 -0000 1.11 @@ -73,8 +73,8 @@ * a hashmap of color profiles and a list of external xml. */ protected void end() { - if (children != null) { - for (Iterator iter = children.iterator(); iter.hasNext();) { + if (childNodes != null) { + for (Iterator iter = childNodes.iterator(); iter.hasNext();) { FONode node = (FONode)iter.next(); if (node.getName().equals("fo:color-profile")) { ColorProfile cp = (ColorProfile)node; @@ -101,7 +101,7 @@ } } } - children = null; + childNodes = null; } public void acceptVisitor(FOTreeVisitor fotv) { 1.14 +1 -1 xml-fop/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java Index: LayoutMasterSet.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- LayoutMasterSet.java 26 Jun 2004 19:37:13 -0000 1.13 +++ LayoutMasterSet.java 24 Jul 2004 22:56:31 -0000 1.14 @@ -73,7 +73,7 @@ * @see org.apache.fop.fo.FONode#end */ protected void end() { - if (children == null) { + if (childNodes == null) { missingChildElementError("(simple-page-master|page-sequence-master)+"); } } 1.11 +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.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- PageSequenceMaster.java 17 Jun 2004 07:02:13 -0000 1.10 +++ PageSequenceMaster.java 24 Jul 2004 22:56:31 -0000 1.11 @@ -80,7 +80,7 @@ } protected void end() { - if (children == null) { + if (childNodes == null) { missingChildElementError("(single-page-master-reference|" + "repeatable-page-master-reference|repeatable-page-master-alternatives)+"); } 1.9 +1 -1 xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java Index: RepeatablePageMasterAlternatives.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- RepeatablePageMasterAlternatives.java 20 Jun 2004 07:46:13 -0000 1.8 +++ RepeatablePageMasterAlternatives.java 24 Jul 2004 22:56:31 -0000 1.9 @@ -74,7 +74,7 @@ * @see org.apache.fop.fo.FONode#end */ protected void end() { - if (children == null) { + if (childNodes == null) { missingChildElementError("(conditional-page-master-reference+)"); } } 1.12 +2 -2 xml-fop/src/java/org/apache/fop/fo/pagination/StaticContent.java Index: StaticContent.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fo/pagination/StaticContent.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- StaticContent.java 13 Jul 2004 20:27:35 -0000 1.11 +++ StaticContent.java 24 Jul 2004 22:56:31 -0000 1.12 @@ -60,7 +60,7 @@ * @see org.apache.fop.fo.FONode#end */ protected void end() { - if (children == null) { + if (childNodes == null) { missingChildElementError("(%block;)+"); } getFOInputHandler().endFlow(this); 1.18 +1 -1 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.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- AbstractLayoutManager.java 13 Jul 2004 00:16:22 -0000 1.17 +++ AbstractLayoutManager.java 24 Jul 2004 22:56:31 -0000 1.18 @@ -79,7 +79,7 @@ this.fobj = fo; foID = fobj.getID(); markers = fobj.getMarkers(); - childLMiter = new LMiter(this, fobj.getChildren()); + childLMiter = new LMiter(this, fobj.getChildNodes()); } /** 1.42 +11 -11 xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java Index: AddLMVisitor.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -r1.41 -r1.42 --- AddLMVisitor.java 22 May 2004 21:44:37 -0000 1.41 +++ AddLMVisitor.java 24 Jul 2004 22:56:31 -0000 1.42 @@ -185,10 +185,10 @@ } public void serveFObjMixed(FObjMixed node) { - if (node.getChildren() != null) { + if (node.getChildNodes() != null) { InlineStackingLayoutManager lm; lm = new InlineStackingLayoutManager(node); - lm.setLMiter(new LMiter(lm, node.getChildren())); + lm.setLMiter(new LMiter(lm, node.getChildNodes())); currentLMList.add(lm); } } @@ -253,7 +253,7 @@ return area; } }; - lm.setLMiter(new LMiter(lm, node.getChildren())); + lm.setLMiter(new LMiter(lm, node.getChildNodes())); currentLMList.add(lm); } @@ -347,13 +347,13 @@ leaderArea = fa; } else if (node.getLeaderPattern() == Constants.LeaderPattern.USECONTENT) { - if (node.getChildren() == null) { + if (node.getChildNodes() == null) { node.getLogger().error("Leader use-content with no content"); return null; } InlineStackingLayoutManager lm; lm = new InlineStackingLayoutManager(node); - lm.setLMiter(new LMiter(lm, node.getChildren())); + lm.setLMiter(new LMiter(lm, node.getChildNodes())); lm.initialize(); // get breaks then add areas to FilledArea @@ -479,15 +479,15 @@ * @return the viewport inline area */ public Viewport getInstreamForeignObjectInlineArea(InstreamForeignObject node) { - if (node.getChildren() == null) { + if (node.getChildNodes() == null) { return null; } - if (node.children.size() != 1) { + if (node.childNodes.size() != 1) { // error return null; } - FONode fo = (FONode)node.children.get(0); + FONode fo = (FONode) node.childNodes.get(0); if (!(fo instanceof XMLObj)) { // error return null; @@ -610,7 +610,7 @@ org.w3c.dom.Document doc = child.getDOMDocument(); String ns = child.getDocumentNamespace(); - node.children = null; + node.childNodes = null; ForeignObject foreign = new ForeignObject(doc, ns); Viewport areaCurrent = new Viewport(foreign); @@ -894,7 +894,7 @@ */ public void serveWrapper(Wrapper node) { ListIterator baseIter; - baseIter = node.getChildren(); + baseIter = node.getChildNodes(); if (baseIter == null) return; while (baseIter.hasNext()) { FObj child = (FObj) baseIter.next(); 1.29 +3 -3 xml-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.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- RTFHandler.java 13 Jul 2004 20:59:02 -0000 1.28 +++ RTFHandler.java 24 Jul 2004 22:56:31 -0000 1.29 @@ -1231,8 +1231,8 @@ private void recurseFObj(FObj fobj) { invokeDeferredEvent(fobj, true); - if (fobj.children!=null) { - for(Iterator it=fobj.children.iterator();it.hasNext();) { + if (fobj.childNodes != null) { + for(Iterator it=fobj.childNodes.iterator();it.hasNext();) { recurseFObj( (FObj) it.next() ); } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]