Klasse PrintHelper

java.lang.Object
net.simplace.core.service.PrintHelper
Alle implementierten Schnittstellen:
Printable, Runnable

public class PrintHelper extends Object implements Runnable, Printable
This helper class provides methods used for printing stuff on a printing device.
Autor:
Martin Uhlir
  • Felddetails

  • Methodendetails

    • print

      public static void print(Component aComponent, FWObservable aObservable) throws PrinterException
      Prints a GUI component on a printer. Before printing is started, a cross-platform dialog appears to the user who can select the desired printer and customise the print properties. If the print dialog is canceled, no print job will start.
      Parameter:
      aComponent - a GUI component to be printed
      aObservable -
      Löst aus:
      PrinterException - is thrown, if no print service is available or any error in the print system caused the job to be aborted
    • print

      public static void print(Component aComponent) throws PrinterException
      Prints a GUI component on a printer. Before printing is started, a cross-platform dialog appears to the user who can select the desired printer and customise the print properties. If the print dialog is canceled, no print job will start.
      Parameter:
      aComponent - a GUI component to be printed
      Löst aus:
      PrinterException - is thrown, if no print service is available or any error in the print system caused the job to be aborted
    • run

      public void run()
      Handles the whole printing process.
      Note: it's implemented in a new thread because looking up the printing device takes a lot of time
      Angegeben von:
      run in Schnittstelle Runnable
    • print

      public int print(Graphics g, PageFormat pf, int pageIndex)
      Angegeben von:
      print in Schnittstelle Printable