APIdia Launch Partner
Top Description Fields Constructors Methods
sun.print

pack-priv Class OpenBook

extends Object
implements Pageable
Class Inheritance
All Implemented Interfaces
java.awt.print.Pageable
Imports
java.awt.print.Pageable, .PageFormat, .Printable

A Book with an unknown number of pages where each page has the same format and painter. This class is used by PrinterJob to print Pageable jobs.

Field Summary

Modifier and TypeField and Description
private PageFormat
mFormat

The format of all of the pages.

private Printable
mPainter

The object that will render all of the pages.

Constructor Summary

AccessConstructor and Description
pack-priv
OpenBook(PageFormat format, Printable painter)

Create a Pageable with an unknown number of pages where every page shares the same format and Printable.

Method Summary

Modifier and TypeMethod and Description
public int
getNumberOfPages()

Implements java.awt.print.Pageable.getNumberOfPages.

This object does not know the number of pages.

public PageFormat

Returns:

The PageFormat describing the size and orientation
getPageFormat
(int
The zero based index of the page whose PageFormat is being requested.
pageIndex
)

Implements java.awt.print.Pageable.getPageFormat.

Return the PageFormat of the page specified by 'pageIndex'.

public Printable

Returns:

The Printable that will draw the page.
getPrintable
(int
The zero based index of the page whose Printable is being requested.
pageIndex
)

Implements java.awt.print.Pageable.getPrintable.

Return the Printable instance responsible for rendering the page specified by 'pageIndex'.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mFormatback to summary
private PageFormat mFormat

The format of all of the pages.

mPainterback to summary
private Printable mPainter

The object that will render all of the pages.

Constructor Detail

OpenBookback to summary
pack-priv OpenBook(PageFormat format, Printable painter)

Create a Pageable with an unknown number of pages where every page shares the same format and Printable.

Method Detail

getNumberOfPagesback to summary
public int getNumberOfPages()

Implements java.awt.print.Pageable.getNumberOfPages.

This object does not know the number of pages.

getPageFormatback to summary
public PageFormat getPageFormat(int pageIndex)

Implements java.awt.print.Pageable.getPageFormat.

Return the PageFormat of the page specified by 'pageIndex'.

Parameters
pageIndex:int

The zero based index of the page whose PageFormat is being requested.

Returns:PageFormat

The PageFormat describing the size and orientation

getPrintableback to summary
public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException

Implements java.awt.print.Pageable.getPrintable.

Return the Printable instance responsible for rendering the page specified by 'pageIndex'.

Parameters
pageIndex:int

The zero based index of the page whose Printable is being requested.

Returns:Printable

The Printable that will draw the page.

Exceptions
IndexOutOfBoundsException:

Doc from java.awt.print.Pageable.getPrintable.

if the Pageable does not contain the requested page.