Package org.axsl.common

Examples of org.axsl.common.PositiveIntegerFormatter


     * If necessary, creates a new page label range entry in the PDF document.
     * @param page The new area tree page being processed.
     */
    private void checkPageLabels(final Page page) {
        final PageCollection currentCollection = page.getParent();
        final PositiveIntegerFormatter currentFormatter =
                currentCollection.getPageNumberFormatter();
        final PdfPageLabelStyle labelStyle = PDFRenderer
                .convertPageLabelStyle(currentFormatter.getType());

        /* Handle special case of the first page. */
        if (this.currentAreaTreePage == null) {
            this.pdfDoc.addPageLabelRange(0, labelStyle,
                    currentCollection.getPageNumberPrefix(), page.getNumber());
            return;
        }

        /* In all other cases, we are looking for changes from the last page. */
        final PageCollection previousCollection =
                this.currentAreaTreePage.getParent();
        if (currentCollection == previousCollection) {
            /* The pages are in the same PageCollection. No new page label range
             * entry is needed. */
            return;
        }
        final PositiveIntegerFormatter previousFormatter =
            previousCollection.getPageNumberFormatter();
        if (currentFormatter.getType() == previousFormatter.getType()
                && currentCollection.getPageNumberPrefix()
                        .equals(previousCollection.getPageNumberPrefix())
                && page.getNumber() == this.pageCount) {
            return;
        }
View Full Code Here

TOP

Related Classes of org.axsl.common.PositiveIntegerFormatter

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.