|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.wildcrest.j2printerworks.PrintingEventHandler
Convenience class for easy handling of J2PrinterWorks print progress events including
beginning and end of printing, OK or cancel of print dialog, OK or cancel of page setup dialog,
start and end of each printed
page, and open and close of print preview dialog. To use, just call
printer.addPropertyChangeListener(new MyPrintingEventHandler()) where MyPrintingEventHandler
extends PrintingEventHandler and overrides any methods of interest.
All methods (except propertyChange and exceptionThrown)
have empty implementations, so to process any desired event(s), you override the
corresponding method and wait for it to be called. The exceptionThrown method has a default
implementation of e.printStackTrace() and can be overridden if you wish to have error fail silently
of if you wish to respond to such errors yourself. The propertyChange method is the central event handling method
of PrintingEventHandler that listens to all events and calls the other PrintingEventHandler methods when appropriate
and should generally be left unchanged.
Constructor Summary | |
PrintingEventHandler()
PrintingEventHandler class constructor. |
Method Summary | |
void |
exceptionThrown(java.lang.Exception e)
Called once when an Exception (usually a java.awt.print.PrinterException) occurs during printing, default implementation is e.printStackTrace() |
void |
pageDone(int pageNumber)
Called each time a page completes printing (pageNumber 1...n) |
void |
pageSetupDialogCanceled()
Called once when user presses "Cancel" in page setup dialog |
void |
pageSetupDialogOK()
Called once when user presses "OK" in page setup dialog |
void |
pageStart(int pageNumber)
Called each time a page begins printing (pageNumber 1...n) |
void |
printDialogCanceled()
Called once when user presses "Cancel" in print dialog |
void |
printDialogOK()
Called once when user presses "OK" in print dialog |
void |
printingDone()
Called once when printing completes |
void |
printingStart()
Called once when printing begins |
void |
printPreviewDone()
Called once when print preview dialog is closed |
void |
printPreviewStart()
Called once when print preview dialog opens |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
Low-level printer event property change method (do not modify) |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PrintingEventHandler()
Method Detail |
public void printingStart()
public void printingDone()
public void printDialogOK()
public void printDialogCanceled()
public void pageSetupDialogOK()
public void pageSetupDialogCanceled()
public void pageStart(int pageNumber)
public void pageDone(int pageNumber)
public void printPreviewStart()
public void printPreviewDone()
public void exceptionThrown(java.lang.Exception e)
public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |