Package org.axsl.fo.fo

Examples of org.axsl.fo.fo.PageSequence


         * search backward. */
        List<Marker> additionalMarkers = null;
        final PageCollection pageCollection = getPageCollection();
        if (retrieve.traitRetrieveBoundary()
                == RetrieveBoundary.PAGE_SEQUENCE) {
            final PageSequence pageSequence = pageCollection.getPageSequence();
            if (pageSequence == getPageSequence()) {
                additionalMarkers = pageCollection
                        .getCurrentPageSequenceMarkers();
            }
        } else if (retrieve.traitRetrieveBoundary()
View Full Code Here


        } else if (Force.EVEN.equals(forceValue)) {
            if (getCurrentPageNumber() % 2 == 1) {
                isBlank = true;
             }
        }
        final PageSequence pageSeq = getPageSequence();
        SimplePageMaster spm = null;
        try {
            spm = this.pageMasterResolver.getNextPageMaster(isBlank);
        } catch (final FoTreeException e) {
            throw new AreaTreeException(e);
        }
        final PageRA newPage = PageRA.makePageArea(spm, this);
        this.children.add(newPage);
        final int newPageNumber = getCurrentPageNumber();
        newPage.setNumber(newPageNumber);
        final CharSequence formattedPageNumber = pageSeq.formatPageNumber(
                newPageNumber);
        newPage.setFormattedNumber(formattedPageNumber);
        if (!isBlank) {
            getLogger().info("[" + formattedPageNumber + "]");
        } else {
View Full Code Here

     * an PageCollection to meet the related PageSequence's constraints.
     * @throws AreaTreeException If the FO Tree cannot provide the
     * information needed to add the pages needed for padding.
     */
    public void padPagesAtBeginning() throws AreaTreeException {
        final PageSequence pageSeq = getPageSequence();
        final PageCollection previousPageCollection = previousPageCollection();
        if (previousPageCollection == null) {
            this.currentPageNumber = pageSeq.traitInitialPageNumber(0);
            return;
        }
        final int lastPageNumber =
                previousPageCollection.getCurrentPageNumber() - 1;
        final int computedPageNumber = pageSeq.traitInitialPageNumber(
                lastPageNumber);
        if (pageSeq.initialPageNumberSetExplicitly()) {
            /*
             * If the user set the page number explicitly, there is nothing
             * else to do but set it and go.
             */
            this.currentPageNumber = computedPageNumber;
            return;
        }
        final int pagesToAdd = computedPageNumber - lastPageNumber - 1;
        if (pagesToAdd > 0) {
        /*
         * For now, the most number of blank pages we will create here is 1.
         *
         * We could conceivably create as many blank pages as would be required
         * to get to a user-set initial-page-number="<number>", but for now we
         * won't.
         *
         * It is tempting to ensure that an odd initial-page-number will start
         * on an odd page, and vice versa, but we won't do that because the
         * user has the ability to tell us to do that explicitly.
         *
         * For other initial-page-number settings, there could be as many as
         * 3 blank pages generated between page-sequences. We're not sure, but
         * we think that this is not the intent of the standard. Here are some
         * examples:
         *
         * Example 1: The previous page-sequence has
         * force-page-count="end-on-even", the last page with content in that
         * page-sequence is an odd page, and the current page-sequence has
         * initial-page-number="auto-odd". There must be two blank pages to
         * satisfy these constraints, one created at the end of the previous
         * page-sequence, one at the beginning of this one.
         *
         * Example 2: The same as Example 1, except that the current
         * page-sequence has initial-page-number="auto-even". Unless a page
         * can be part of two different page sequences, this requires a total
         * of three blank pages, one created at the end of the previous
         * page-sequence, and two at the beginning of this one.
         *
         * The standard does not seem to be clear on this issue. For now, we
         * will assume that the intent of the standard is that there could be
         * 0, 1, or 2 blank pages, but not any more than that. For there to be
         * more than one, one would have to be generated in the padPagesAtEnd
         * method, so the most we should allow here is 1.
         */
            final PageSequence previousPageSequence
                    = previousPageCollection.getPageSequence();
            if (previousPageSequence.traitForcePageCount(this)
                    == ForcePageCount.AUTO) {
                /*
                 * In this case we'll try to put the added page in the previous
                 * page-sequence, to comply with the standard.
                 */
 
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void layoutComplete() throws AreaTreeException {
        final PageSequence pageSeq = getPageSequence();
        switch (pageSeq.traitForcePageCount(this)) {
        case AUTO: {
            /*
             * The standard would seem to imply that force-page-count="auto"
             * needs to consider the initial-page-number value for the
             * following page-sequence. However, since padPagesAtBeginning will
View Full Code Here

        /* TODO: It seems like this logic should be done once when the
         * PageCollection is first started, and cached there for reuse. */
        if (footArea.getChildCount() != 0) {
            return;
        }
        final PageSequence pageSeq = bac.getPage()
                .getPageCollection().getPageSequence();
        final StaticContent separator = pageSeq.getFootnoteSeparator();
        if (separator == null) {
            return;
        }
        final StaticContentPL staticPL = (StaticContentPL)
                getLayoutProxy(separator);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void processPageSequence(final PageCollection pageCollection)
            throws AreaTreeException {
        final PageSequence pageSeq = pageCollection.getPageSequence();
        for (org.axsl.fo.fo.Flow flow : pageSeq.getFlows()) {
            processFlow(pageCollection, flow);
        }
    }
View Full Code Here

     * @throws AreaTreeException For errors during layout.
     */
    public void formatStaticContent(final PageArea pageArea)
            throws AreaTreeException {
        final PageCollection areaTree = pageArea.getPageCollection();
        final PageSequence pageSeq = areaTree.getPageSequence();
        final SimplePageMaster simpleMaster = pageArea.getPageMaster();

        // region-before
        layoutStaticContent(pageSeq, simpleMaster.getRegionBefore(),
                pageArea.getRegionBefore());
View Full Code Here

TOP

Related Classes of org.axsl.fo.fo.PageSequence

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.