java.lang.Object
java.awt.print.Book
- 所有已实现的接口:
-
Pageable
- 参见:
-
Field Summary
Fields declared in interface java.awt.print.Pageable
UNKNOWN_NUMBER_OF_PAGES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappend(Printable painter, PageFormat page) 将单个页面附加到此Book的末尾。voidappend(Printable painter, PageFormat page, int numPages) 将numPages页附加到此Book的末尾。int返回此Book中的页面数。getPageFormat(int pageIndex) 返回由pageIndex指定的页面的PageFormat。getPrintable(int pageIndex) 返回负责渲染由pageIndex指定的页面的Printable实例。voidsetPage(int pageIndex, Printable painter, PageFormat page) 为指定的页码设置PageFormat和Painter。
-
Constructor Details
-
Book
public Book()创建一个新的空白Book。
-
-
Method Details
-
getNumberOfPages
public int getNumberOfPages()返回此Book中的页面数。- 指定者:
-
getNumberOfPages在接口Pageable - 返回:
-
此
Book包含的页面数。
-
getPageFormat
返回由pageIndex指定的页面的PageFormat。- 指定者:
-
getPageFormat在接口Pageable - 参数:
-
pageIndex- 要请求其PageFormat的页面的从零开始的索引 - 返回:
-
描述页面大小和方向的
PageFormat。 - 抛出:
-
IndexOutOfBoundsException- 如果Pageable不包含请求的页面
-
getPrintable
返回负责渲染由pageIndex指定的页面的Printable实例。- 指定者:
-
getPrintable在接口Pageable - 参数:
-
pageIndex- 要请求其Printable的页面的从零开始的索引 - 返回:
-
渲染页面的
Printable。 - 抛出:
-
IndexOutOfBoundsException- 如果Pageable不包含请求的页面
-
setPage
public void setPage(int pageIndex, Printable painter, PageFormat page) throws IndexOutOfBoundsException 为指定的页码设置PageFormat和Painter。- 参数:
-
pageIndex- 要更改其绘制器和格式的页面的从零开始的索引 -
painter- 渲染页面的Printable实例 -
page- 页面的大小和方向 - 抛出:
-
IndexOutOfBoundsException- 如果指定的页面尚未在此Book中 -
NullPointerException- 如果painter或page参数为null
-
append
将单个页面附加到此Book的末尾。- 参数:
-
painter- 渲染页面的Printable实例 -
page- 页面的大小和方向 - 抛出:
-
NullPointerException- 如果painter或page参数为null
-
append
将numPages页附加到此Book的末尾。每个页面都与page相关联。- 参数:
-
painter- 渲染页面的Printable实例 -
page- 页面的大小和方向 -
numPages- 要添加到此Book中的页面数 - 抛出:
-
NullPointerException- 如果painter或page参数为null
-