2362N/A * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * The <code>Book</code> class provides a representation of a document in 0N/A * which pages may have different page formats and page painters. This 0N/A * class uses the {@link Pageable} interface to interact with a 0N/A * {@link PrinterJob}. 0N/A /* Class Constants */ 0N/A /* Class Variables */ 0N/A /* Instance Variables */ 0N/A * The set of pages that make up the Book. 0N/A /* Instance Methods */ 0N/A * Creates a new, empty <code>Book</code>. 0N/A * Returns the number of pages in this <code>Book</code>. 0N/A * @return the number of pages this <code>Book</code> contains. 0N/A * Returns the {@link PageFormat} of the page specified by 0N/A * <code>pageIndex</code>. 0N/A * @param pageIndex the zero based index of the page whose 0N/A * <code>PageFormat</code> is being requested 0N/A * @return the <code>PageFormat</code> describing the size and 0N/A * orientation of the page. 0N/A * @throws IndexOutOfBoundsException if the <code>Pageable</code> 0N/A * does not contain the requested page 0N/A * Returns the {@link Printable} instance responsible for rendering 0N/A * the page specified by <code>pageIndex</code>. 0N/A * @param pageIndex the zero based index of the page whose 0N/A * <code>Printable</code> is being requested 0N/A * @return the <code>Printable</code> that renders the page. 0N/A * @throws IndexOutOfBoundsException if the <code>Pageable</code> 0N/A * does not contain the requested page 0N/A * Sets the <code>PageFormat</code> and the <code>Painter</code> for a 0N/A * specified page number. 0N/A * @param pageIndex the zero based index of the page whose 0N/A * painter and format is altered 0N/A * @param painter the <code>Printable</code> instance that 0N/A * @param page the size and orientation of the page 0N/A * @throws IndexOutOfBoundsException if the specified 0N/A * page is not already in this <code>Book</code> 0N/A * @throws NullPointerException if the <code>painter</code> or 0N/A * <code>page</code> argument is <code>null</code> 0N/A * Appends a single page to the end of this <code>Book</code>. 0N/A * @param painter the <code>Printable</code> instance that 0N/A * @param page the size and orientation of the page 0N/A * @throws <code>NullPointerException</code> 0N/A * If the <code>painter</code> or <code>page</code> 0N/A * argument is <code>null</code> 0N/A * Appends <code>numPages</code> pages to the end of this 0N/A * <code>Book</code>. Each of the pages is associated with 0N/A * <code>page</code>. 0N/A * @param painter the <code>Printable</code> instance that renders 0N/A * @param page the size and orientation of the page 0N/A * @param numPages the number of pages to be added to the 0N/A * this <code>Book</code>. 0N/A * @throws <code>NullPointerException</code> 0N/A * If the <code>painter</code> or <code>page</code> 0N/A * argument is <code>null</code> 0N/A * Return the BookPage for the page specified by 'pageIndex'. 0N/A * The BookPage inner class describes an individual 0N/A * page in a Book through a PageFormat-Printable pair. 0N/A * The size and orientation of the page. 0N/A * The instance that will draw the page. 0N/A * A new instance where 'format' describes the page's 0N/A * size and orientation and 'painter' is the instance 0N/A * that will draw the page's graphics. 0N/A * @throws NullPointerException 0N/A * If the <code>painter</code> or <code>format</code> 0N/A * argument is <code>null</code> 0N/A * Return the instance that paints the 0N/A * Return the format of the page.