Package org.apache.fop.fo

Examples of org.apache.fop.fo.FONode


        childNodes = new ArrayList();
        Iterator markerIter = marker.getChildNodes();
        cloneSubtree(markerIter, this, marker, descPLists);
        // reparent the property lists of the direct children
        for (Iterator iter = getChildNodes(); iter.hasNext(); ) {
            FONode child = (FONode) iter.next();
            Marker.MarkerPropertyList pList
                = (Marker.MarkerPropertyList) descPLists.get(child);
            if (pList != null) {
                pList.setParentPropertyList(propertyList);
            }
View Full Code Here


     * Bind the new nodes to the property values in this context
     * @param descPLists the map of the new nodes to property lists
     */
    private void bindChildren(Map descPLists) throws FOPException {
        for (Iterator i = descPLists.keySet().iterator(); i.hasNext(); ) {
            FONode desc = (FONode) i.next();
            PropertyList descPList;
            if (desc instanceof FObj) {
                descPList = (PropertyList) descPLists.get(desc);
                ((FObj) desc).bind(descPList);
            } else if (desc instanceof FOText) {
                descPList = (PropertyList) descPLists.get(desc.getParent());
                if (descPList == null) {
                    descPList = propertyList;
                }
                ((FOText) desc).bind(descPList);
            }
View Full Code Here

        savePropertyListMaker = null;
        // unparent the child property lists
        Iterator iter = getChildNodes();
        if (iter != null) {
            while (iter.hasNext()) {
                FONode child = (FONode) iter.next();
                MarkerPropertyList pList
                    = (MarkerPropertyList) descPLists.get(child);
                if (pList != null) {
                    pList.setParentPropertyList(null);
                }
View Full Code Here

        return (Property) v;
    }
   
    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

    public void setRow(TableRow row) {
        this.row = row;
    }

    public TableBody getBody() {
        FONode node = getCell();
        while (node != null && !(node instanceof TableBody)) {
            node = node.getParent();
        }
        return (TableBody)node;
    }
View Full Code Here

        }
        return (TableBody)node;
    }
   
    public Table getTable() {
        FONode node = getBody();
        while (node != null && !(node instanceof Table)) {
            node = node.getParent();
        }
        if (node == null && getColumn() != null) {
            node = getColumn().getParent();
        }
        return (Table)node;
View Full Code Here

   
    /**
     * @return the table owning this cell
     */
    public Table getTable() {
        FONode node = fobj.getParent();
        while (!(node instanceof Table)) {
            node = node.getParent();
        }
        return (Table)node;
    }
View Full Code Here

     * @see org.apache.fop.fo.FONode#endOfNode()
     */
    protected void endOfNode() throws FOPException {
        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;
                    if (!"".equals(cp.getColorProfileName())) {
                        if (colorProfiles == null) {
                            colorProfiles = new java.util.HashMap();
                        }
                        if (colorProfiles.get(cp.getColorProfileName()) != null) {
                            // duplicate names
                            getLogger().warn("Duplicate fo:color-profile profile name : "
                                    + cp.getColorProfileName());
                        }
                        colorProfiles.put(cp.getColorProfileName(), cp);
                    } else {
                        getLogger().warn("color-profile-name required for color profile");
                    }
                } else {
                    getLogger().debug("Ignoring element " + node.getName()
                            + " inside fo:declarations.");
                }
            }
        }
        childNodes = null;
View Full Code Here

         * white-space), then check whether the nearest non-wrapper
         * ancestor allows this.
         */
        if (child instanceof FOText
                && ((FOText)child).willCreateArea()) {
            FONode ancestor = parent;
            while (ancestor.getNameId() == Constants.FO_WRAPPER) {
                ancestor = ancestor.getParent();
            }
            if (!(ancestor instanceof FObjMixed)) {
                invalidChildError(
                        getLocator(),
                        getLocalName(),
View Full Code Here

        invokeDeferredEvent(foNode, true);

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

            FONode regionBefore = (FONode) pageSequence.flowMap.get("xsl-region-before");
            FONode regionAfter  = (FONode) pageSequence.flowMap.get("xsl-region-after");

            if (regionBefore != null) {
                recurseFONode(regionBefore);
            }

            if (regionAfter != null) {
                recurseFONode(regionAfter);
            }

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

            //recurse all table-columns
            for (Iterator it = table.getColumns().iterator(); it.hasNext();) {
                recurseFONode( (FONode) it.next() );
            }

            //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

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.