Package org.apache.fop.fo

Examples of org.apache.fop.fo.FONode


        if (foNode instanceof PageSequence) {
            PageSequence pageSequence = (PageSequence) foNode;

            Region regionBefore = pagemaster.getRegion(Constants.FO_REGION_BEFORE);
            if (regionBefore != null) {
                FONode staticBefore = (FONode) pageSequence.getFlowMap().get(
                        regionBefore.getRegionName());
                if (staticBefore != null) {
                    recurseFONode(staticBefore);
                }
            }
            Region regionAfter = pagemaster.getRegion(Constants.FO_REGION_AFTER);
            if (regionAfter != null) {
                FONode staticAfter = (FONode) pageSequence.getFlowMap().get(
                        regionAfter.getRegionName());
                if (staticAfter != null) {
                    recurseFONode(staticAfter);
                }
            }


            recurseFONode( pageSequence.getMainFlow() );
        } else if (foNode instanceof Table) {
            Table table = (Table) foNode;

            //recurse all table-columns
            if (table.getColumns() != null) {
              //Calculation for column-widths which are not set
              prepareTable(table);

              for (Iterator it = table.getColumns().iterator(); it.hasNext();) {
                  recurseFONode( (FONode) it.next() );
              }
            } else {
                //TODO Implement implicit column setup handling!
                log.warn("No table-columns found on table. RTF output requires that all"
                        + " table-columns for a table are defined. Output will be incorrect.");
            }

            //recurse table-header
            if (table.getTableHeader() != null) {
                recurseFONode( table.getTableHeader() );
            }

            //recurse table-footer
            if (table.getTableFooter() != null) {
                recurseFONode( table.getTableFooter() );
            }

            if (foNode.getChildNodes() != null) {
                for (Iterator it = foNode.getChildNodes(); it.hasNext();) {
                    recurseFONode( (FONode) it.next() );
                }
            }
        } else if (foNode instanceof ListItem) {
            ListItem item = (ListItem) foNode;

            recurseFONode(item.getLabel());
            recurseFONode(item.getBody());
        } else if (foNode instanceof Footnote) {
            Footnote fn = (Footnote)foNode;

            recurseFONode(fn.getFootnoteCitation());
            recurseFONode(fn.getFootnoteBody());
        } else {
            //Any other FO-Object: Simply recurse through all childNodes.
            if (foNode.getChildNodes() != null) {
                for (Iterator it = foNode.getChildNodes(); it.hasNext();) {
                    FONode fn = (FONode)it.next();
                    if (log.isTraceEnabled()) {
                        log.trace("  ChildNode for " + fn + " (" + fn.getName() + ")");
                    }
                    recurseFONode(fn);
                }
            }
        }
View Full Code Here


        // Note: areasGenerated was already public so I use it, but this
        // is definitely not very good style!
        if (containingTable!=null && containingTable.areasGenerated > 0) {
            int numChildren = this.children.size();
            for (int i = this.marker; i < numChildren; i++) {
                FONode fo = (FONode)children.get(i);
                int status;
                if (Status.isIncomplete(status = fo.layout(area))) {
                    this.marker = i;
                    return status;
                }
            }
        }
View Full Code Here

     * @param idReferences the id to remove
     */
    public void removeID(IDReferences idReferences) {
        int numChildren = this.children.size();
        for (int i = 0; i < numChildren; i++) {
            FONode child = (FONode)children.get(i);
            if ((child instanceof FObj)) {
                ((FObj)child).removeID(idReferences);
            }
        }
    }
View Full Code Here

            baseIter = node.getChildNodes();
            if (baseIter == null) {
                return;
            }
            while (baseIter.hasNext()) {
                FONode child = (FONode) baseIter.next();
                makeLayoutManagers(child, lms);
            }
        }      
View Full Code Here

            baseIter = node.getChildNodes();
            if (baseIter == null) {
                return;
            }
            while (baseIter.hasNext()) {
                FONode child = (FONode) baseIter.next();
                makeLayoutManagers(child, lms);
            }
        }      
View Full Code Here

                break;
            default:
                List rowGroupsList = new LinkedList();
                // TODO this is ugly
                for (FONodeIterator iter = table.getChildNodes(); iter.hasNext();) {
                    FONode node = iter.nextNode();
                    if (node instanceof TableBody) {
                        rowGroupsList.addAll(((TableBody) node).getRowGroups());
                    }
                }
                rowGroupsIter = rowGroupsList.iterator();
View Full Code Here

       
    }
   
    private boolean isInherited(PropertyList pList) {
        if (pList.getFObj().getUserAgent().isBreakIndentInheritanceOnReferenceAreaBoundary()) {
            FONode nd = pList.getFObj().getParent();
            return !((nd instanceof FObj) && ((FObj)nd).generatesReferenceAreas());
        } else {
            return true;
        }
    }
View Full Code Here

        }
        List newLMs = new ArrayList(size);
        while (fobjIter.hasNext() && newLMs.size() < size ) {
            Object theobj = fobjIter.next();
            if (theobj instanceof FONode) {
                FONode foNode = (FONode) theobj;
                if (foNode instanceof RetrieveMarker) {
                    foNode = getPSLM().resolveRetrieveMarker(
                        (RetrieveMarker) foNode);
                }
                if (foNode != null) {
View Full Code Here

    private void cloneSingleNode(FONode child, FONode newParent,
                            Marker marker, PropertyList parentPropertyList)
        throws FOPException {

        if (child != null) {
            FONode newChild = child.clone(newParent, true);
            if (child instanceof FObj) {
                Marker.MarkerPropertyList pList;
                PropertyList newPropertyList = createPropertyListFor(
                            (FObj) newChild, parentPropertyList);
               
                pList = marker.getPropertyListFor(child);
                newChild.processNode(
                        child.getLocalName(),
                        getLocator(),
                        pList,
                        newPropertyList);
                if (newChild instanceof TableFObj) {
                    // TODO calling startOfNode (and endOfNode, below) on other fobjs may
                    // have undesirable side-effects. This is really ugly and will need to
                    // be addressed sooner or later
                    ((TableFObj) newChild).startOfNode();
                }
                addChildTo(newChild, (FObj) newParent);
                if (newChild.getNameId() == FO_TABLE) {
                    Table t = (Table) child;
                    cloneSubtree(t.getColumns().listIterator(),
                            newChild, marker, newPropertyList);
                    cloneSingleNode(t.getTableHeader(),
                            newChild, marker, newPropertyList);
View Full Code Here

     */
    private void cloneSubtree(Iterator parentIter, FONode newParent,
                              Marker marker, PropertyList parentPropertyList)
        throws FOPException {
        if (parentIter != null) {
            FONode child;
            while (parentIter.hasNext()) {
                child = (FONode) parentIter.next();
                cloneSingleNode(child, newParent,
                        marker, parentPropertyList);
            }
View Full Code Here

TOP

Related Classes of org.apache.fop.fo.FONode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.