public class BatchPrinter extends Vector implements RandomPrintable
| Modifier and Type | Field and Description |
|---|---|
String |
documentName |
protected Printer |
myPrinter |
int[] |
numPages |
PrinterControl |
printerControl
A default PrinterControl Object that initially has no values
set.
|
capacityIncrement, elementCount, elementDataUNKNOWN_NUMBER_OF_PAGESserialVersionUID| Constructor and Description |
|---|
BatchPrinter(String docName) |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustPrinterProperties(PrinterProperties p)
Adjust the PrinterProperties as necessary.
|
int |
countPages(PageFormat page)
This is called when printing is about to start and it requests a count of the number of pages
that would be necessary to print.
|
String |
getDocumentName() |
PointDrawable |
getPage(PageFormat pf,
int pageIndex)
Get a PointDrawable for a particular page.
|
PageFormat |
getPreferredFormat()
Return the preferred format for printing, or null if there is no preferred format.
|
boolean |
print(Handle handle,
PointGraphics g,
PageFormat page,
PointRect areaOnPage,
int pageIndex)
This is called for each page as the document is being printed.
|
void |
printingComplete()
This is called after printing is complete and indicates that the Printable object
can release resources associated with it.
|
void |
printingStarting(Printer printer)
This is called before printing starts and before countPages() is called.
|
void |
releasePage(PointDrawable pd) |
boolean |
validatePage(PageFormat page,
int pageIndex)
This should return true if the page with the specified index should be printed.
|
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, firstElement, get, indexOf, indexOf, insertElementAt, isEmpty, iterator, lastElement, lastIndexOf, lastIndexOf, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, setElementAt, setSize, size, toArray, toArray, toString, trimToSizeequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequals, hashCodepublic String documentName
public int[] numPages
protected Printer myPrinter
public PrinterControl printerControl
public BatchPrinter(String docName)
public void adjustPrinterProperties(PrinterProperties p)
adjustPrinterProperties in interface Printablepublic void printingStarting(Printer printer)
PrintableprintingStarting in interface Printablepublic boolean print(Handle handle, PointGraphics g, PageFormat page, PointRect areaOnPage, int pageIndex)
Printablepublic boolean validatePage(PageFormat page, int pageIndex)
PrintablevalidatePage in interface Printablepublic int countPages(PageFormat page)
PrintablecountPages in interface Printablepublic void printingComplete()
PrintableprintingComplete in interface Printablepublic String getDocumentName()
getDocumentName in interface Printablepublic PageFormat getPreferredFormat()
PrintablegetPreferredFormat in interface Printablepublic PointDrawable getPage(PageFormat pf, int pageIndex)
RandomPrintablegetPage in interface RandomPrintablepf - the PageFormat to be used.pageIndex - the index of the page - starting from zero.public void releasePage(PointDrawable pd)
releasePage in interface RandomPrintable