Examples of BlockContentFactory


Examples of org.axsl.area.BlockContentFactory

                 * content.*/
                inlineArea = null;
                /* Since this is block content, it cannot be laid out in a
                 * line. We need to find the ancestor BlockContentFactory
                 * and lay out the item in it. */
                final BlockContentFactory blockContentFactory =
                        areaNode.ancestorBlockContentFactory();
                status = layoutProxy.layout(blockContentFactory, graftingPoint);
            } else {
                if (inlineArea == null) {
                    final LineContentFactory lineContentFactory = getLineContentFactory(areaNode);
View Full Code Here

Examples of org.axsl.area.BlockContentFactory

        }
        if (! (overflow instanceof BlockContentFactory)) {
            throw new AreaTreeException("NormalBlockArea overflow parent "
                    + "expected to be a BlockContentFactory.");
        }
        final BlockContentFactory bcFactory = (BlockContentFactory) overflow;
        final Block block = this.traitGeneratedBy();
        final org.axsl.area.NormalBlockArea nbArea
                = bcFactory.makeNormalBlockArea(block,
                        this.getGraftingPoint());
        return (NormalBlockArea) nbArea;
    }
View Full Code Here

Examples of org.axsl.area.BlockContentFactory

            final GraftingPoint graftingPoint) throws AreaTreeException {
        if (! (areaNode instanceof BlockContentFactory)) {
            throw new AreaTreeException("Area \"" + areaNode.getAreaName()
                    + "\" cannot contain a NormalBlockArea.");
        }
        final BlockContentFactory bcArea = (BlockContentFactory) areaNode;

        if (! this.breakStatusBeforeChecked) {
            this.breakStatusBeforeChecked = true;
            // no break if first in area tree, or leading in context
            // area
            final Status breakBeforeStatus = getLayout().checkBreakBefore(
                    this.node, areaNode.nearestArea());
            if (breakBeforeStatus != Status.OK) {
                return breakBeforeStatus;
            }
        }

        NormalBlockArea blockArea;

        if (! this.anythingLaidOut) {
            this.noLayoutCount++;
        }
        if (this.noLayoutCount > this.infLoopThreshhold) {
            throw new AreaTreeException(
                "No meaningful layout in block after many attempts.\n"
                    + "Infinite loop is assumed. Processing halted. Context:\n"
                    + this.node.getContextMessage());
        }

        if (getProgress() == FONodePL.BREAK_AFTER) {
            return Status.OK;
        }

        if (getProgress() == FONodePL.START) {
            // Reset the "loop counter".
            this.noLayoutCount = 0;

            if (areaNode instanceof NormalBlockArea) {
                getLayout().completeCurrentLineInBlock(
                        (NormalBlockArea) areaNode);
            }
            setProgress(0);
        }

        blockArea = bcArea.makeNormalBlockArea(this.node, graftingPoint);

        for (int i = getProgress(); i < this.node.getChildCount(); i++) {
            final Fo fo = this.node.getChildAt(i);
            final FONodePL nodePL = this.getLayoutProxy(fo);
View Full Code Here

Examples of org.axsl.area.BlockContentFactory

            final GraftingPoint graftingPoint) throws AreaTreeException {
        if (! (areaNode instanceof BlockContentFactory)) {
            throw new AreaTreeException("Area \"" + areaNode.getAreaName()
                    + "\" cannot contain a BlockContentArea.");
        }
        final BlockContentFactory bcArea = (BlockContentFactory) areaNode;

        if (getProgress() == FONodePL.START) {
            setProgress(0);
        }

        final BlockContainerRefArea blockContainer =
                bcArea.makeBlockContainerArea(this.node, graftingPoint);

        for (int i = this.getProgress(); i < this.node.getChildCount(); i++) {
            final Fo fo = this.node.getChildAt(i);
            final FObjPL fobjPL = (FObjPL) getLayoutProxy(fo);
            fobjPL.layout(blockContainer, graftingPoint);
View Full Code Here

Examples of org.axsl.area.BlockContentFactory

        if (! (areaNode instanceof BlockContentFactory)) {
            throw new AreaTreeException("Area \"" + areaNode.getAreaName()
                    + "\" cannot contain a TableArea.");
        }
        final BlockContentFactory bcArea = (BlockContentFactory) areaNode;

        if (getProgress() == FONodePL.START) {
            if (areaNode instanceof NormalBlockArea) {
                getLayout().completeCurrentLineInBlock(
                        (NormalBlockArea) areaNode);
            }
            setProgress(0);

            if (this.table.traitBreakBefore(areaNode) == Break.PAGE) {
                return Status.FORCE_PAGE_BREAK;
            }

            if (this.table.traitBreakBefore(areaNode) == Break.ODD_PAGE) {
                return Status.FORCE_PAGE_BREAK_ODD;
            }

            if (this.table.traitBreakBefore(areaNode) == Break.EVEN_PAGE) {
                return Status.FORCE_PAGE_BREAK_EVEN;
            }

            /* Process the marker children. */
            for (int i = getProgress(); i < this.table.qtyMarkerChildren();
                    i++) {
                final Fo fo = this.table.getChildAt(i);
                if (fo instanceof Marker) {
                    final MarkerPL markerPL = (MarkerPL) getLayoutProxy(fo);
                    markerPL.layout(areaNode, graftingPoint);
                    this.setProgress(i);
                } else {
                    throw new AreaTreeException("Marker object expected.");
                }
            }
        }

        /* For now, we bail out if the columns widths are not specified. */
        if (this.table.numberOfColumns() == 0) {
            getLayout().getLogger().warn("Current implementation of tables "
                    + "requires a table-column for each column, "
                    + "indicating column-width: "
                    + this.table.getContextMessage());
            return Status.OK;
        }

        final TableArea tableArea = bcArea.makeTableArea(this.table,
                graftingPoint);

        Status status = null;

        /* Process the table header if we are on the first page/column, or if
View Full Code Here

Examples of org.axsl.area.BlockContentFactory

            final GraftingPoint graftingPoint) throws AreaTreeException {
        if (! (areaNode instanceof BlockContentFactory)) {
            throw new AreaTreeException("Area \"" + areaNode.getAreaName()
                    + "\" cannot contain a ListBlockArea.");
        }
        final BlockContentFactory bcArea = (BlockContentFactory) areaNode;

        final ListBlockPL listBlockPL = (ListBlockPL) getLayoutProxy(this.node);
        if (listBlockPL.getProgress() == FONodePL.START) {
            listBlockPL.setProgress(0);

            if (areaNode instanceof NormalBlockArea) {
                getLayout().completeCurrentLineInBlock(
                        (NormalBlockArea) areaNode);
            }
        }

        final ListBlockArea blockArea = bcArea.makeListBlockArea(this.node,
                graftingPoint);

        final int numChildren = this.node.getChildCount();
        for (int i = listBlockPL.getProgress(); i < numChildren; i++) {
            final ListItem listItem = (ListItem) this.node.getChildAt(i);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.