| java.lang.Object com.ibm.richtext.print.MConstTextPrintable
MConstTextPrintable | final class MConstTextPrintable (Code) | | This class's interface is very close to that of the JDK 1.2 Printable
interface, but can execute on JDK 1.1. On 1.2, this class is wrapped
in a real Printable. On 1.1, the PrintContext class uses this class
and a PrintJob for printing.
Note that this class paginates the text in the first call to print,
or to getPageCount.
After construction, its page size is essentially fixed. This is not
as flexible as the 1.2 classes allow, but it should suffice.
|
Method Summary | |
int | getPageCount(Graphics graphics) Return the number of pages that can be printed. | int | print(Graphics graphics, int pageNumber) Print the given page in the given graphics. |
NO_SUCH_PAGE | final static int NO_SUCH_PAGE(Code) | | |
PAGE_EXISTS | final static int PAGE_EXISTS(Code) | | |
MConstTextPrintable | MConstTextPrintable(MConstText text, AttributeMap defaultStyles, Rectangle pageRect)(Code) | | Construct an MConstTextPrintable to print the given text. Each page will fit
into pageRect.
|
getPageCount | int getPageCount(Graphics graphics)(Code) | | Return the number of pages that can be printed.
Parameters: graphics - a Graphics instance representative of those which will be printed into |
print | int print(Graphics graphics, int pageNumber)(Code) | | Print the given page in the given graphics. Page numbers are
0-based. The the return value indicates whether
the page number is valid (as in JDK 1.2). Since you can get the page count
directly, there's really no excuse for passing in an invalid page
index.
Parameters: graphics - the Graphics to print to Parameters: pageNumber - the 0-based page number. Should be nonnegative andless than getPageCount() PAGE_EXISTS if the page number is valid, or NO_SUCH_PAGE otherwise |
|
|