Methods Summary |
---|
public void | append(java.awt.print.Printable painter, java.awt.print.PageFormat page)Appends a single page to the end of this Book .
mPages.addElement(new BookPage(painter, page));
|
public void | append(java.awt.print.Printable painter, java.awt.print.PageFormat page, int numPages)Appends numPages pages to the end of this
Book . Each of the pages is associated with
page .
BookPage bookPage = new BookPage(painter, page);
int pageIndex = mPages.size();
int newSize = pageIndex + numPages;
mPages.setSize(newSize);
for(int i = pageIndex; i < newSize; i++){
mPages.setElementAt(bookPage, i);
}
|
public int | getNumberOfPages()Returns the number of pages in this Book .
return mPages.size();
|
private java.awt.print.Book$BookPage | getPage(int pageIndex)Return the BookPage for the page specified by 'pageIndex'.
return (BookPage) mPages.elementAt(pageIndex);
|
public java.awt.print.PageFormat | getPageFormat(int pageIndex)Returns the {@link PageFormat} of the page specified by
pageIndex .
return getPage(pageIndex).getPageFormat();
|
public java.awt.print.Printable | getPrintable(int pageIndex)Returns the {@link Printable} instance responsible for rendering
the page specified by pageIndex .
return getPage(pageIndex).getPrintable();
|
public void | setPage(int pageIndex, java.awt.print.Printable painter, java.awt.print.PageFormat page)Sets the PageFormat and the Painter for a
specified page number.
if (painter == null) {
throw new NullPointerException("painter is null");
}
if (page == null) {
throw new NullPointerException("page is null");
}
mPages.setElementAt(new BookPage(painter, page), pageIndex);
|