Package org.axsl.fo

Examples of org.axsl.fo.Fo


    /**
     * {@inheritDoc}
     */
    public void resetProgress() {
        super.resetProgress();
        final Fo thisNode = this.getFONode();
        for (int i = 0; i < thisNode.getChildCount(); i++) {
            final Fo node = thisNode.getChildAt(i);
            final FONodePL nodePL = getLayoutProxy(node);
            nodePL.resetProgress();
        }
    }
View Full Code Here


        snapshot = super.getProgressSnapshot(snapshot);
        // terminate if no kids or child not yet accessed
        if (getProgress() < 0) {
            return snapshot;
        }
        final Fo thisNode = this.getFONode();
        if (thisNode.getChildCount() < 1) {
            return snapshot;
        }
        final Fo node = thisNode.getChildAt(getProgress());
        final FONodePL proxy = getLayoutProxy(node);
        return proxy.getProgressSnapshot(snapshot);
    }
View Full Code Here

     * Roll the layout progress back to a given snapshot.
     * @param snapshot The snapshot to which progress should be rolled back.
     */
    public void rollback(final List<Integer> snapshot) {
        super.rollback(snapshot);
        final Fo thisNode = this.getFONode();
        if ((getProgress() == -1)
                || thisNode.getChildCount() < 1
                || getProgress() <= START) {
            return;
        }
        for (int i = getProgress() + 1; i < thisNode.getChildCount(); i++) {
            final Fo fo = thisNode.getChildAt(i);
            getLayoutProxy(fo).resetProgress();
        }
        final Fo node = thisNode.getChildAt(getProgress());
        getLayoutProxy(node).rollback(snapshot);
    }
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public Status layout(final AreaNode areaNode,
            final GraftingPoint graftingPoint) throws AreaTreeException {
        final Fo node = getFONode();
        final TableArea tableArea = (TableArea) areaNode;
        final Table table = tableArea.traitGeneratedBy();
        if (getProgress() == FONodePL.BREAK_AFTER) {
            return Status.OK;
        }

        if (getProgress() == FONodePL.START) {
            if (this.rowSpanMgr == null) {
                this.rowSpanMgr = new RowSpanMgr(table.getTableColumns().length,
                        this.getLayout());
            }

            // if (this.isInListBody) {
            // startIndent += bodyIndent + distanceBetweenStarts;
            // }

            setProgress(0);
        }

        /*
         * Note: the parent FO must be a Table. The parent Area is the Block
         * type area created by the Table, which is also a reference area.
         * The content "width" (IPD) of the TableBody is the same as that
         * of the containing table area, and its relative position is 0,0.
         * Strictly speaking (CR), this FO should generate no areas!
         */
        AbstractTablePartContainer areaContainer = null;
        if (node instanceof TableBody) {
            areaContainer = tableArea.makeTableBodyContainer(
                    (TableBody) node, graftingPoint);
        } else if (node instanceof TableHeader) {
            areaContainer = tableArea.makeTableHeaderContainer(
                    (TableHeader) node, graftingPoint);
        } else if (node instanceof TableFooter) {
            areaContainer = tableArea.makeTableFooterContainer(
                    (TableFooter) node, graftingPoint);
        }

        List<TableRow> keepWith = new ArrayList<TableRow>();
        final int numChildren = node.getChildCount();
        TableRow lastRow = null;
        boolean endKeepGroup = true;
        for (int i = getProgress(); i < numChildren; i++) {
            final Fo child = node.getChildAt(i);
            if (child instanceof Marker) {
                final MarkerPL markerPL = (MarkerPL) getLayoutProxy(child);
                markerPL.layout(tableArea, graftingPoint);
                continue;
            }
View Full Code Here

        this.areaContainer = cellArea;

        final int numChildren = this.node.getChildCount();
        for (int i = getProgress(); this.bDone == false && i < numChildren;
                i++) {
            final Fo fo = this.node.getChildAt(i);

            // Overflows may cause a row to be re-layedout,
            // need to pass already processed content.
            setProgress(i);
View Full Code Here

    /**
     * Returns the writing-mode for this area.
     * @return The writing-mode for this area.
     */
    public WritingMode getWritingMode() {
        final Fo generatedBy = traitGeneratedBy();
        if (generatedBy instanceof WritingModePa) {
            return ((WritingModePa) generatedBy).traitWritingMode(this);
        }
        return this.ancestorArea().getWritingMode();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String traitId() {
        final Fo generatedBy = this.traitGeneratedBy();
        if (generatedBy instanceof IdPa) {
            return ((IdPa) generatedBy).traitId();
        }
        return null;
    }
View Full Code Here

        final RegionBodyRefArea bac = (RegionBodyRefArea) areaNode;

        boolean prevChildMustKeepWithNext = false;
        final int numChildren = getFONode().getChildCount();
        for (int i = getProgress(); i < numChildren; i++) {
            final Fo fo = getFONode().getChildAt(i);

            if (bac.getMainRefArea().isBalancingRequired(fo)) {
                // reset the the just-done span area in preparation
                // for a backtrack for balancing
                bac.getMainRefArea().resetSpanArea();

                rollback(getProgressSnapshot());
                // one less because of the "continue"
                i = getProgress() - 1;
                continue;
            }
            // current column area
            final Area currentArea = bac.getMainRefArea().getNormalFlow(fo);
            if (bac.getMainRefArea().isNewSpanArea()) {
                setProgress(i);
                setProgressSnapshot(getProgressSnapshot(new
                        ArrayList<Integer>()));
            }

            setStatus(getLayoutProxy(fo).layout(currentArea, graftingPoint));

            if (getStatus().isIncomplete()) {
                if (prevChildMustKeepWithNext
                        && (getStatus().laidOutNone())) {
                    setProgress(i - 1);
                    final Fo prevChild = getFONode().getChildAt(getProgress());
                    final FObjPL prevChildPL = (FObjPL) getLayoutProxy(
                            prevChild);
                    prevChildPL.resetProgress();
                    setStatus(Status.AREA_FULL_SOME);
                    return getStatus();
View Full Code Here

            setProgress(0);
        }

        final int numChildren = this.node.getChildCount();
        for (int i = getProgress(); i < numChildren; i++) {
            final Fo fo = this.node.getChildAt(i);

            final Status status = getLayoutProxy(fo).layout(container,
                    graftingPoint);
            if (status.isIncomplete()) {
                setProgress(i);
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.