Package org.axsl.fo

Examples of org.axsl.fo.Fo


     * @return The status of the layout.
     * @throws AreaTreeException For errors during layout.
     */
    protected Status standardLayout(final AreaNode areaNode,
            final GraftingPoint graftingPoint) throws AreaTreeException {
        final Fo foNode = getFONode();
        if (getProgress() == FONodePL.START) {
            setProgress(0);
        }
        for (int i = getProgress(); i < foNode.getChildCount(); i++) {
            final Fo fo = foNode.getChildAt(i);
            final Status status = getLayoutProxy(fo).layout(areaNode,
                    graftingPoint);
            if (status.isIncomplete()) {
                setProgress(i);
                return status;
View Full Code Here


        final FoLineText contextAware = lineText.getContextWrapper(
                foContext);
        try {
            status = lb.processLineContent(contextAware, start, end, lineArea);
        } catch (final TextException e) {
            final Fo generatedBy = lineArea.traitGeneratedBy();
            throw new AreaTreeException("Error in text layout:\n"
                    + generatedBy.getContextMessage(), e);
        }
        this.layout.setLineBreaker(lb);
        if (status >= end) {
            return -1;
        }
View Full Code Here

        final FoLineNonText contextAware = nonText.getContextWrapper(
                foContext);
        try {
            status = lb.processLineContent(contextAware, -1, -1, lineArea);
        } catch (final TextException e) {
            final Fo generatedBy = lineArea.traitGeneratedBy();
            throw new AreaTreeException("Error in non-text layout:\n"
                    + generatedBy.getContextMessage());
        }
        this.layout.setLineBreaker(lb);
        return status;
    }
View Full Code Here

        FoContext foContext = inputLineArea;
        if (graftingPoint != null) {
            foContext = new OverrideGraftingContext(inputLineArea,
                    graftingPoint);
        }
        final Fo node = this.getFONode();
        LineArea lineArea = inputLineArea;
        if (! (node instanceof FoLineNonText)) {
            return Status.UNKNOWN;
        }
        final FoLineNonText nonText = (FoLineNonText) node;
        // this should start a new page
        if (lineArea == null) {
            return Status.AREA_FULL_SOME;
        }
        if (addNonTextItemToLine(lineArea, nonText, foContext) == 1) {
            // It fit on the line.
            return Status.OK;
        }
        // It did not fit on the line. Create new line & try again.
        final NormalBlockArea blockArea
                = (NormalBlockArea) lineArea.ancestorArea();
        lineArea = blockArea.makeLineArea(false);
        final BlockPL blockPL = this.layout.getBlockPL(blockArea);
        blockPL.setCurrentLineArea(lineArea);

        if (lineArea == null) {
            return Status.AREA_FULL_SOME;
        }
        if (addNonTextItemToLine(lineArea, nonText, foContext) == 1) {
            return Status.OK;
        }
        getLogger().error(node.getName() + " does not fit on line:\n"
                + node.getContextMessage());
        return Status.OK;
    }
View Full Code Here

            blockArea = (NormalBlockArea) areaNode;
        } else {
            blockArea = areaNode.ancestorNormalBlockArea();
        }
        if (blockArea == null) {
            final Fo foNode = this.getFONode();
            throw new AreaTreeException("Layout of inline objects must be "
                    + "inside a block:\n" + foNode.getContextMessage());
        }
        final BlockPL blockPL = this.layout.getBlockPL(blockArea);
        return blockPL.getCurrentLineArea(blockArea);
    }
View Full Code Here

     * Creates the child areas for this bookmark area.
     * @param bookmark The "generated-by" Bookmark.
     */
    public void makeChildren(final Bookmark bookmark) {
        for (int i = 0; i < bookmark.getChildCount(); i++) {
            final Fo child = bookmark.getChildAt(i);
            if (child instanceof Bookmark) {
                this.makeBookmarkArea((Bookmark) child);
            } else if (child instanceof BookmarkTitle) {
                this.layoutBookmarkTitle((BookmarkTitle) child);
            }
View Full Code Here

        }

        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);

            Status status = null;
            boolean doneProcessingItem = false;
            while (! doneProcessingItem) {
View Full Code Here

        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);
        }

        return Status.OK;
View Full Code Here

            }

            /* 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
         * we are not to omit at breaks. */
        if (tableArea.isFirstChildOfGeneratedBy()
                || ! this.table.traitTableOmitHeaderAtBreak(tableArea)) {
            status = layoutTableHeader(tableArea, graftingPoint);
            if (status.isIncomplete()) {
                this.resetAll(tableArea);
                return Status.AREA_FULL_NONE;
            }
        }

        /* See if the table footer will fit.
         * We don't really want the footer to come before the body, but the
         * AreaTree is responsible to keep the order and position of the
         * Areas correct. */
        status = layoutTableFooter(tableArea, graftingPoint);
        if (status.isIncomplete()) {
            this.resetAll(tableArea);
            return Status.AREA_FULL_NONE;
        }

        /* Process the table body(s). */
        for (int i = getProgress(); i < this.table.getChildCount(); i++) {
            final Fo fo = this.table.getChildAt(i);
            if (fo instanceof TableBody) {
                status = getLayoutProxy(fo).layout(tableArea,
                        graftingPoint);
                if (status.isIncomplete()) {
                    setProgress(i);
View Full Code Here

        final MarkerPL markerPL = (MarkerPL) this.getLayoutProxy(bestMarker);
        // Necessary because the marker may get used multiple times.
        markerPL.resetProgress();
        markerPL.setProgress(0);
        for (int i = 0; i < bestMarker.getChildCount(); i++) {
            final Fo fo = bestMarker.getChildAt(i);
            getLayoutProxy(fo).layout(areaNode, this.node);
        }
        return Status.OK;
    }
View Full Code Here

TOP

Related Classes of org.axsl.fo.Fo

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.