Class Printer

All Implemented Interfaces:
Printable, Runnable, PrintJobListener, DocumentListener

@ParametersAreNonnullByDefault public class Printer extends Object implements Runnable, DocumentListener, Printable, PrintJobListener
  • Field Details

    • template

      private static final String template
      See Also:
    • base

      private final String base
      the base directory of the templates
    • log

      private final Logger log
      the logging mechanism log4j
    • runner

      private Thread runner
      the tread that runs after initialization
    • j2dr

      private Java2DRenderer j2dr
      the renderer used to render the xhtml dom tree into the page
    • file

      private final File file
    • uac

      private final UserAgentCallback uac
  • Constructor Details

    • Printer

      public Printer(File file)
      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
      Specified by:
      run in interface Runnable
    • main

      public static void main(String[] args)
      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 interface DocumentListener
    • 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 interface DocumentListener
    • onLayoutException

      public void onLayoutException(Throwable t)
      Description copied from interface: DocumentListener
      Called when document layout failed with an exception. All Throwable objects thrown (except for ThreadDeath) during layout and not otherwise handled will be provided to this method. If a DocumentListener 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 interface DocumentListener
    • onRenderException

      public void onRenderException(Throwable t)
      Description copied from interface: DocumentListener
      Called when document render failed with an exception. All Throwable objects thrown (except for ThreadDeath) during render and not otherwise handled will be provided to this method. If a DocumentListener 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 interface DocumentListener
    • print

      public int print(Graphics graphics, PageFormat pf, int pi)
      Specified by:
      print in interface Printable
    • printDataTransferCompleted

      public void printDataTransferCompleted(PrintJobEvent pje)
      Specified by:
      printDataTransferCompleted in interface PrintJobListener
    • printJobCanceled

      public void printJobCanceled(PrintJobEvent pje)
      Specified by:
      printJobCanceled in interface PrintJobListener
    • printJobCompleted

      public void printJobCompleted(PrintJobEvent pje)
      Specified by:
      printJobCompleted in interface PrintJobListener
    • printJobFailed

      public void printJobFailed(PrintJobEvent pje)
      Specified by:
      printJobFailed in interface PrintJobListener
    • printJobNoMoreEvents

      public void printJobNoMoreEvents(PrintJobEvent pje)
      Specified by:
      printJobNoMoreEvents in interface PrintJobListener
    • printJobRequiresAttention

      public void printJobRequiresAttention(PrintJobEvent pje)
      Specified by:
      printJobRequiresAttention in interface PrintJobListener