All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.awt.print.Book

java.lang.Object
    |
    +----java.awt.print.Book

public class Book
extends Object
A Book maintains a list of pages to be printed.


Class Index

 o Book.PageAndPainter
The PageAndPainter inner class holds the PageFormat- Printable pair associated with a given page.

Variable Index

 o UNKNOWN_NUMBER_OF_PAGES
Pass this constant to the setNumberOfPages method to indicate that the number of pages in the book is unknown and thus the book is open ended.

Constructor Index

 o Book()
Create a new book containing no pages.

Method Index

 o append(PageFormat, Printable)
Append a single page to the end of this document.
 o append(PageFormat, Printable, int)
Append 'numPages' pages to the end of this document.
 o appendPageAndPainter(Book.PageAndPainter)
Append a page format and Printable instance pair enclosed in a PageAndPainter instance to the end of the book.
 o getNumberOfPages()
Return the number of pages in this document.
 o getPageAndPainter(int)
Return our inner class that holds both the PageFormat and the Printable instances for a given page.
 o getPageFormat(int)
Return the page format for the 'pageNumber'th page int he book.
 o getPagePainter(int)
Return the Printable instance, the painter, responsible for drawing the page specified by 'pageNumber'.
 o setPage(int, PageFormat, Printable)
Set the page format and the painter for a given page number.

Variables

 o UNKNOWN_NUMBER_OF_PAGES
public static final int UNKNOWN_NUMBER_OF_PAGES
Pass this constant to the setNumberOfPages method to indicate that the number of pages in the book is unknown and thus the book is open ended.

Constructors

 o Book
public Book()
Create a new book containing no pages.

Methods

 o getNumberOfPages
public int getNumberOfPages()
Return the number of pages in this document.

 o setPage
public void setPage(int pageNumber,
                    PageFormat page,
                    Printable painter) throws IndexOutOfBoundsException
Set the page format and the painter for a given page number. If the page specified is not already in the book, then an IndexOutOfBoundsException excpetion is thrown.

 o getPageFormat
public PageFormat getPageFormat(int pageNumber) throws IndexOutOfBoundsException
Return the page format for the 'pageNumber'th page int he book. If there is no such page in the book, then throw an IndexOutOfBoundsException exception.

 o getPagePainter
public Printable getPagePainter(int pageNumber) throws IndexOutOfBoundsException
Return the Printable instance, the painter, responsible for drawing the page specified by 'pageNumber'.

 o getPageAndPainter
protected Book.PageAndPainter getPageAndPainter(int pageNumber) throws IndexOutOfBoundsException
Return our inner class that holds both the PageFormat and the Printable instances for a given page.

 o append
public void append(PageFormat page,
                   Printable painter)
Append a single page to the end of this document.

 o append
public void append(PageFormat page,
                   Printable painter,
                   int numPages)
Append 'numPages' pages to the end of this document. Each of the pages is associated with 'page'.

 o appendPageAndPainter
protected void appendPageAndPainter(Book.PageAndPainter pageAndPainter)
Append a page format and Printable instance pair enclosed in a PageAndPainter instance to the end of the book.


All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature