Package org.axsl.area

Examples of org.axsl.area.TableArea


                    + "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);
                    status = Status.AREA_FULL_SOME;
                    if (this.bodyCount == 0
                            && status == Status.AREA_FULL_NONE) {
                        resetAll(tableArea);
                    }
                    return status;
                }
                this.bodyCount++;
            }
        }

        if (this.table.getTableFooter() != null
                && this.table.traitTableOmitFooterAtBreak(areaNode)) {
            final TableFooter tf = this.table.getTableFooter();
            final TableFooterPL tfPL = (TableFooterPL) getLayoutProxy(tf);
            status = tfPL.layout(tableArea, graftingPoint);
            if (status.isIncomplete()) {
                // this is a problem since we need to remove a row
                // from the last table body and place it on the
                // next page so that it can have a footer at
                // the end of the table.
                getLayout().getLogger().warn("footer could not fit on page, "
                        + "moving last body row to next page");
                final TableFooterPL tableFooterPL
                        = (TableFooterPL) this.getLayoutProxy(tf);
                final TableFooterContainer footerArea =
                        tableArea.getTableFooterContainer();
                tableArea.removeChild(footerArea);
                tableFooterPL.resetProgress();
                return Status.AREA_FULL_SOME;
            }
        }

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();
View Full Code Here

     * @param context An object that knows how to resolve FO Tree context
     * issues.
     * @return The allocation height of the cell area.
     */
    public int getHeight(final FoContext context) {
        final TableArea tableArea = this.areaContainer.ancestorTableArea();
        final Table table = tableArea.traitGeneratedBy();
        return this.areaContainer.crBpd()
                + table.traitBorderSeparationBpd(context)
                - (this.node.traitBorderBeforeWidth(context)
                + this.node.traitBorderAfterWidth(context))
                / 2;
View Full Code Here

TOP

Related Classes of org.axsl.area.TableArea

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.