Java Platform 1.2
Beta 4

Class java.awt.print.Book

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

public class Book
extends 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.
 
Method Summary
 void append(Printable painter, PageFormat page, int numPages)
          Append 'numPages' pages to the end of this Book.
 void append(Printable painter, PageFormat page)
          Append a single page to the end of this Book.
 int getNumberOfPages()
          Return the number of pages in this Book.
 PageFormat getPageFormat(int pageIndex)
          Return the PageFormat of the page specified by 'pageIndex'.
 Printable getPrintable(int pageIndex)
          Return the Printable instance responsible for rendering the page specified by 'pageIndex'.
 void setPage(int pageIndex, Printable painter, PageFormat page)
          Set the page format and the painter for a given page number.
 
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

Constructor Detail

Book

public Book()
Create a new, empty book.
Method Detail

getNumberOfPages

public int getNumberOfPages()
Return the number of pages in this Book.
Specified by:
getNumberOfPages in interface Pageable

getPageFormat

public PageFormat getPageFormat(int pageIndex)
                         throws IndexOutOfBoundsException
Return the PageFormat of the page specified by 'pageIndex'.
Specified by:
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:
IndexOutOfBoundsException - the Pageable does not contain the requested page.

getPrintable

public Printable getPrintable(int pageIndex)
                       throws IndexOutOfBoundsException
Return the Printable instance responsible for rendering the page specified by 'pageIndex'.
Specified by:
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:
IndexOutOfBoundsException - the Pageable does not contain the requested page.

setPage

public void setPage(int pageIndex,
                    Printable painter,
                    PageFormat page)
             throws 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:
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.

Java Platform 1.2
Beta 4

Submit a bug or feature
Submit comments/suggestions about new javadoc look
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.
This documentation was generated with a post-Beta4 version of Javadoc.