public class Book extends Object implements Pageable
Pageable
,
PrinterJob
UNKNOWN_NUMBER_OF_PAGES
Constructor and Description |
---|
Book()
创建一个新的、空的
Book 。
|
Modifier and Type | Method and Description |
---|---|
void |
append(Printable painter, PageFormat page)
添加一个单页本
Book 结束。
|
void |
append(Printable painter, PageFormat page, int numPages)
追加
numPages 页本
Book 结束。
|
int |
getNumberOfPages()
在这
Book 返回的页面数量。
|
PageFormat |
getPageFormat(int pageIndex)
返回指定的页面
PageFormat
pageIndex 。
|
Printable |
getPrintable(int pageIndex)
返回指定的
pageIndex 负责渲染页面的
Printable 实例。
|
void |
setPage(int pageIndex, Printable painter, PageFormat page)
集
PageFormat 和指定页码的
Painter 。
|
public int getNumberOfPages()
Book
返回的页面数量。
getNumberOfPages
接口
Pageable
Book
包含的页数。
public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException
PageFormat
pageIndex
。
getPageFormat
接口
Pageable
pageIndex
-基于零的索引页面被请求的
PageFormat
PageFormat
。
IndexOutOfBoundsException
-如果
Pageable
不包含请求的页面
public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException
Printable
负责绘制指定的
pageIndex
页。
getPrintable
接口
Pageable
pageIndex
-基于零的索引页面被请求的
Printable
Printable
呈现页。
IndexOutOfBoundsException
-如果
Pageable
不包含请求的页面
public void setPage(int pageIndex, Printable painter, PageFormat page) throws IndexOutOfBoundsException
PageFormat
和指定页码的
Painter
。
pageIndex
-基于零的索引页的画家和格式的改变
painter
-
Printable
实例呈现页
page
-页面的大小和方向
IndexOutOfBoundsException
-如果指定的页面是不是已经在这
Book
NullPointerException
-如果
painter
或
page
论点是
null
public void append(Printable painter, PageFormat page)
Book
结束。
painter
-
Printable
实例呈现页
page
-页面的大小和方向
NullPointerException
-如果
painter
或
page
论点是
null
public void append(Printable painter, PageFormat page, int numPages)
numPages
页本
Book
结束。每个页面与
page
。
painter
-
Printable
实例呈现页
page
-页面的大小和方向
numPages
-页数被添加到这个
Book
。
NullPointerException
-如果
painter
或
page
论点是
null
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.