public class PrinterJobProgress extends Progress implements java.awt.print.Printable
PrinterJob printerJob = PrinterJob.getPrinterJob();
PrintRequestAttributeSet attributeSet = new HashPrintRequestAttributeSet();
Progress progress = new PrinterJobProgress(null, printerJob, attributeSet, data);
progress.startProgress();
....
progress.waitUntilFinished();
PROP_PROGRESS_INDETERMINATE, PROP_PROGRESS_STATUS, PROP_PROGRESS_STEP, PROP_PROGRESS_TOTAL, STATUS_CANCELED, STATUS_COMPLETED, STATUS_ERROR, STATUS_IDLE, STATUS_INITIALIZED, STATUS_NOT_INITIALIZED, STATUS_RUNNING, TYPE_EXPORT, TYPE_INVISIBLE, TYPE_PAGELOADER, TYPE_PRINT, TYPE_SEARCH
Constructor and Description |
---|
PrinterJobProgress(ReportView parent,
java.awt.print.PrinterJob printerJob,
javax.print.attribute.PrintRequestAttributeSet attributeSet,
RenderData data)
Creates a new Thread for printing in the background.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Call this method to force a cancel of the progress - which must also
set both of the states "finished" and "canceled" to true.
|
java.lang.String |
getName()
The name of the daemon thread.
|
void |
initPrintRequestAttributes()
Initialize missing print attributes from the render data.
|
void |
run()
This is the run method of the thread.
|
addPropertyChangeListener, cleanUp, getErrorMessage, getProgress, getReportView, getStatus, getTotalProgress, getType, isCanceled, isErrored, isFinished, isIndeterminate, removePropertyChangeListener, setErrorMessage, setIndeterminate, setProgress, setStatus, setTotalProgress, showError, startProgress, waitUntilFinished
public PrinterJobProgress(ReportView parent, java.awt.print.PrinterJob printerJob, javax.print.attribute.PrintRequestAttributeSet attributeSet, RenderData data)
parent
- if this null then Error messages will not display.printerJob
- The PrinterJob with the target PrintService.attributeSet
- A list of attributes that override values in the report design.
For example paper format, paper orientation and page margins.data
- The data of the report that should be printed.public final java.lang.String getName()
public void cancel()
public void initPrintRequestAttributes()
public void run()
Copyright © 1999-2020 by i-net software GmbH