类java.awt.print.Pageable源码实例Demo

下面列出了怎么用java.awt.print.Pageable的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码2 项目: TencentKona-8   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码3 项目: jdk8u-dev-jdk   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码4 项目: jdk8u60   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码5 项目: openjdk-jdk8u   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码6 项目: openjdk-jdk8u-backup   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码7 项目: Bytecoder   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码8 项目: openjdk-jdk9   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码9 项目: openjdk-jdk9   文件: UnixPrintJob.java
public void pageableJob(Pageable pageable) throws PrintException {
    try {
        synchronized(this) {
            if (job != null) { // shouldn't happen
                throw new PrintException("already printing");
            } else {
                job = new PSPrinterJob();
            }
        }
        job.setPrintService(getPrintService());
        job.setCopies(copies);
        job.setJobName(jobName);
        job.setPageable(pageable);
        job.print(reqAttrSet);
        notifyEvent(PrintJobEvent.DATA_TRANSFER_COMPLETE);
        return;
    } catch (PrinterException pe) {
        notifyEvent(PrintJobEvent.JOB_FAILED);
        throw new PrintException(pe);
    } finally {
        printReturned = true;
        notifyEvent(PrintJobEvent.NO_MORE_EVENTS);
    }
}
 
源代码10 项目: jdk8u-jdk   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码11 项目: hottub   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码12 项目: jdk8u-jdk   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码13 项目: openjdk-8-source   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码14 项目: openjdk-8   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码15 项目: jdk8u_jdk   文件: RasterPrinterJob.java
protected final int getMaxPageAttrib() {
    if (attributes != null) {
        SunMinMaxPage s =
            (SunMinMaxPage)attributes.get(SunMinMaxPage.class);
        if (s != null) {
            return s.getMax();
        }
    }

    Pageable pageable = getPageable();
    if (pageable != null) {
        int numPages = pageable.getNumberOfPages();
        if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
            numPages = MAX_UNKNOWN_PAGES;
        }
        return  ((numPages == 0) ? 1 : numPages);
    }

    return Integer.MAX_VALUE;
}
 
源代码16 项目: dragonwell8_jdk   文件: RasterPrinterJob.java
protected PageFormat getPageFormatFromAttributes() {
    Pageable pageable = null;
    if (attributes == null || attributes.isEmpty() ||
        !((pageable = getPageable()) instanceof OpenBook)) {
        return null;
    }

    PageFormat newPf = attributeToPageFormat(
        getPrintService(), attributes);
    PageFormat oldPf = null;
    if ((oldPf = pageable.getPageFormat(0)) != null) {
        // If orientation, media, imageable area attributes are not in
        // "attributes" set, then use respective values of the existing
        // page format "oldPf".
        if (attributes.get(OrientationRequested.class) == null) {
            newPf.setOrientation(oldPf.getOrientation());
        }

        Paper newPaper = newPf.getPaper();
        Paper oldPaper = oldPf.getPaper();
        boolean oldPaperValWasSet = false;
        if (attributes.get(MediaSizeName.class) == null) {
            newPaper.setSize(oldPaper.getWidth(), oldPaper.getHeight());
            oldPaperValWasSet = true;
        }
        if (attributes.get(MediaPrintableArea.class) == null) {
            newPaper.setImageableArea(
                oldPaper.getImageableX(), oldPaper.getImageableY(),
                oldPaper.getImageableWidth(),
                oldPaper.getImageableHeight());
            oldPaperValWasSet = true;
        }
        if (oldPaperValWasSet) {
            newPf.setPaper(newPaper);
        }
    }
    return newPf;
}
 
源代码17 项目: dragonwell8_jdk   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码18 项目: TencentKona-8   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码19 项目: openjdk-jdk8u   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码20 项目: openjdk-jdk8u-backup   文件: RasterPrinterJob.java
protected PageFormat getPageFormatFromAttributes() {
    if (attributes == null || attributes.isEmpty()) {
        return null;
    }

    PageFormat newPf = attributeToPageFormat(
        getPrintService(), attributes);
    PageFormat oldPf = null;
    Pageable pageable = getPageable();
    if ((pageable != null) &&
        (pageable instanceof OpenBook) &&
        ((oldPf = pageable.getPageFormat(0)) != null)) {
        // If orientation, media, imageable area attributes are not in
        // "attributes" set, then use respective values of the existing
        // page format "oldPf".
        if (attributes.get(OrientationRequested.class) == null) {
            newPf.setOrientation(oldPf.getOrientation());
        }

        Paper newPaper = newPf.getPaper();
        Paper oldPaper = oldPf.getPaper();
        boolean oldPaperValWasSet = false;
        if (attributes.get(MediaSizeName.class) == null) {
            newPaper.setSize(oldPaper.getWidth(), oldPaper.getHeight());
            oldPaperValWasSet = true;
        }
        if (attributes.get(MediaPrintableArea.class) == null) {
            newPaper.setImageableArea(
                oldPaper.getImageableX(), oldPaper.getImageableY(),
                oldPaper.getImageableWidth(),
                oldPaper.getImageableHeight());
            oldPaperValWasSet = true;
        }
        if (oldPaperValWasSet) {
            newPf.setPaper(newPaper);
        }
    }
    return newPf;
}
 
源代码21 项目: jpexs-decompiler   文件: PDFPrinterJob.java
@Override
public void setPageable(Pageable document) throws NullPointerException {
	if (document == null) {
		throw new NullPointerException("Pageable cannot be null.");
	}
	this.pageable = document;
}
 
源代码22 项目: Bytecoder   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码23 项目: openjdk-jdk9   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码24 项目: jdk8u-jdk   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码25 项目: hottub   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码26 项目: openjdk-8-source   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码27 项目: openjdk-8   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码28 项目: jdk8u_jdk   文件: RasterPrinterJob.java
protected PageFormat getPageFormatFromAttributes() {
    Pageable pageable = null;
    if (attributes == null || attributes.isEmpty() ||
        !((pageable = getPageable()) instanceof OpenBook)) {
        return null;
    }

    PageFormat newPf = attributeToPageFormat(
        getPrintService(), attributes);
    PageFormat oldPf = null;
    if ((oldPf = pageable.getPageFormat(0)) != null) {
        // If orientation, media, imageable area attributes are not in
        // "attributes" set, then use respective values of the existing
        // page format "oldPf".
        if (attributes.get(OrientationRequested.class) == null) {
            newPf.setOrientation(oldPf.getOrientation());
        }

        Paper newPaper = newPf.getPaper();
        Paper oldPaper = oldPf.getPaper();
        boolean oldPaperValWasSet = false;
        if (attributes.get(MediaSizeName.class) == null) {
            newPaper.setSize(oldPaper.getWidth(), oldPaper.getHeight());
            oldPaperValWasSet = true;
        }
        if (attributes.get(MediaPrintableArea.class) == null) {
            newPaper.setImageableArea(
                oldPaper.getImageableX(), oldPaper.getImageableY(),
                oldPaper.getImageableWidth(),
                oldPaper.getImageableHeight());
            oldPaperValWasSet = true;
        }
        if (oldPaperValWasSet) {
            newPf.setPaper(newPaper);
        }
    }
    return newPf;
}
 
源代码29 项目: jdk8u-dev-jdk   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
源代码30 项目: jdk8u-jdk   文件: RasterPrinterJob.java
/**
 * Set the range of pages from a Book to be printed.
 * Both 'firstPage' and 'lastPage' are zero based
 * page indices. If either parameter is less than
 * zero then the page range is set to be from the
 * first page to the last.
 */
protected void setPageRange(int firstPage, int lastPage) {
    if(firstPage >= 0 && lastPage >= 0) {
        mFirstPage = firstPage;
        mLastPage = lastPage;
        if(mLastPage < mFirstPage) mLastPage = mFirstPage;
    } else {
        mFirstPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
        mLastPage = Pageable.UNKNOWN_NUMBER_OF_PAGES;
    }
}
 
 类所在包
 同包方法