Package net.simplace.core.service
Klasse PrintHelper
java.lang.Object
net.simplace.core.service.PrintHelper
This helper class provides methods used for printing stuff on a printing device.
- Autor:
- Martin Uhlir
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungstatic final intstatic final intstatic final intVon Schnittstelle geerbte Felder java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic voidPrints a GUI component on a printer.static voidprint(Component aComponent, FWObservable aObservable) Prints a GUI component on a printer.intprint(Graphics g, PageFormat pf, int pageIndex) voidrun()Handles the whole printing process.
-
Felddetails
-
TYPE_PDF
public static final int TYPE_PDF- Siehe auch:
-
TYPE_RTF
public static final int TYPE_RTF- Siehe auch:
-
TYPE_HTML
public static final int TYPE_HTML- Siehe auch:
-
-
Methodendetails
-
print
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 printedaObservable-- 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
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 -
print
-