Class java.awt.print.Book
java.lang.Object
|
+----java.awt.print.Book
- public class Book
- extends java.lang.Object
- implements Pageable
Represents a document in which pages may have different page
page formats and page painters. This class uses the Pageable
interface to interact with a PrinterJob.
|
Constructor Summary
|
Book()
Create a new, empty book.
|
| Methods inherited from class java.lang.Object
|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Book
public Book()
- Create a new, empty book.
getNumberOfPages
public int getNumberOfPages()
- Return the number of pages in this Book.
- Implements:
- getNumberOfPages in interface Pageable
getPageFormat
public PageFormat getPageFormat(int pageIndex) throws java.lang.IndexOutOfBoundsException
- Return the PageFormat of the page specified by 'pageIndex'.
- Implements:
- getPageFormat in interface Pageable
- Parameters:
int
- The zero based index of the page whose
PageFormat is being requested.
- Returns:
- The PageFormat describing the size and orientation
of the page.
- Throws:
- java.lang.IndexOutOfBoundsException - the Pageable does not contain the requested page.
getPrintable
public Printable getPrintable(int pageIndex) throws java.lang.IndexOutOfBoundsException
- Return the Printable instance responsible for rendering
the page specified by 'pageIndex'.
- Implements:
- getPrintable in interface Pageable
- Parameters:
int
- The zero based index of the page whose
Printable is being requested.
- Returns:
- The Printable that will render the page.
- Throws:
- java.lang.IndexOutOfBoundsException - the Pageable does not contain the requested page.
setPage
public void setPage(int pageIndex,
Printable painter,
PageFormat page) throws java.lang.IndexOutOfBoundsException
- Set the page format and the painter for a
given page number.
- Parameters:
int
- The zero based index of the page whose painter
and format will be altered.
painter
- The Printable instance that will draw the page.
page
- The size and orientation of the page.
- Throws:
- java.lang.IndexOutOfBoundsException - The specified page is not
already in the Book.
append
public void append(Printable painter,
PageFormat page)
- Append a single page to the end of this
Book.
- Parameters:
painter
- The Printable instance that will draw the page.
page
- The size and orientation of the page.
append
public void append(Printable painter,
PageFormat page,
int numPages)
- Append 'numPages' pages to the end of this Book.
Each of the pages is associated with 'page'.
- Parameters:
painter
- The Printable instance that will draw the page.
page
- The size and orientation of the page.
int
- The number of pages to be added to the Book.