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, elementData
UNKNOWN_NUMBER_OF_PAGES
serialVersionUID
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, trimToSize
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode
public String documentName
public int[] numPages
protected Printer myPrinter
public PrinterControl printerControl
public BatchPrinter(String docName)
public void adjustPrinterProperties(PrinterProperties p)
adjustPrinterProperties
in interface Printable
public void printingStarting(Printer printer)
Printable
printingStarting
in interface Printable
public boolean print(Handle handle, PointGraphics g, PageFormat page, PointRect areaOnPage, int pageIndex)
Printable
public boolean validatePage(PageFormat page, int pageIndex)
Printable
validatePage
in interface Printable
public int countPages(PageFormat page)
Printable
countPages
in interface Printable
public void printingComplete()
Printable
printingComplete
in interface Printable
public String getDocumentName()
getDocumentName
in interface Printable
public PageFormat getPreferredFormat()
Printable
getPreferredFormat
in interface Printable
public PointDrawable getPage(PageFormat pf, int pageIndex)
RandomPrintable
getPage
in interface RandomPrintable
pf
- the PageFormat to be used.pageIndex
- the index of the page - starting from zero.public void releasePage(PointDrawable pd)
releasePage
in interface RandomPrintable