Class Printer
java.lang.Object
Printer
- All Implemented Interfaces:
Printable
,Runnable
,PrintJobListener
,DocumentListener
@ParametersAreNonnullByDefault
public class Printer
extends Object
implements Runnable, DocumentListener, Printable, PrintJobListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
the base directory of the templatesprivate final File
private Java2DRenderer
the renderer used to render the xhtml dom tree into the pageprivate final Logger
the logging mechanism log4jprivate Thread
the tread that runs after initializationprivate static final String
private final UserAgentCallback
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Indicates document layout has complete, e.g.void
Indicates document has been requested (e.g.static void
The main function is made for debugging this application separately only.void
Called when document layout failed with an exception.void
Called when document render failed with an exception.int
print
(Graphics graphics, PageFormat pf, int pi) void
void
void
void
void
void
void
run()
we're running nowvoid
start()
we're starting the thread
-
Field Details
-
template
- See Also:
-
base
the base directory of the templates -
log
the logging mechanism log4j -
runner
the tread that runs after initialization -
j2dr
the renderer used to render the xhtml dom tree into the page -
file
-
uac
-
-
Constructor Details
-
Printer
the constructor of the cameventprinter: starts logging and starts the thread
-
-
Method Details
-
start
public void start()we're starting the thread -
run
public void run()we're running now -
main
The main function is made for debugging this application separately only. -
documentStarted
public void documentStarted()Description copied from interface:DocumentListener
Indicates document has been requested (e.g. a new document is going to be loaded). This will be called before any activity takes place for the document.- Specified by:
documentStarted
in interfaceDocumentListener
-
documentLoaded
public void documentLoaded()Description copied from interface:DocumentListener
Indicates document layout has complete, e.g. document is fully "loaded" for display; this is not a callback for the document source (e.g. XML) being loaded. This method will be called on every layout run (including, for example, after panel resizes).- Specified by:
documentLoaded
in interfaceDocumentListener
-
onLayoutException
Description copied from interface:DocumentListener
Called when document layout failed with an exception. AllThrowable
objects thrown (except forThreadDeath
) during layout and not otherwise handled will be provided to this method. If aDocumentListener
has been defined an XHTML panel, the listener is entirely responsible for handling the exception. No other action will be taken.- Specified by:
onLayoutException
in interfaceDocumentListener
-
onRenderException
Description copied from interface:DocumentListener
Called when document render failed with an exception. AllThrowable
objects thrown (except forThreadDeath
) during render and not otherwise handled will be provided to this method. If aDocumentListener
has been defined an XHTML panel, the listener is entirely responsible for handling the exception. No other action will be taken.- Specified by:
onRenderException
in interfaceDocumentListener
-
print
-
printDataTransferCompleted
- Specified by:
printDataTransferCompleted
in interfacePrintJobListener
-
printJobCanceled
- Specified by:
printJobCanceled
in interfacePrintJobListener
-
printJobCompleted
- Specified by:
printJobCompleted
in interfacePrintJobListener
-
printJobFailed
- Specified by:
printJobFailed
in interfacePrintJobListener
-
printJobNoMoreEvents
- Specified by:
printJobNoMoreEvents
in interfacePrintJobListener
-
printJobRequiresAttention
- Specified by:
printJobRequiresAttention
in interfacePrintJobListener
-