Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.print.PrinterJob
gnu.java.awt.print.JavaPrinterJob
public class JavaPrinterJob
extends PrinterJob
Constructor Summary | |
|
Method Summary | |
void |
|
PageFormat |
|
int |
|
String |
|
String |
|
boolean |
|
PageFormat |
|
void |
|
void |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
PageFormat |
|
Methods inherited from class java.awt.print.PrinterJob | |
cancel , defaultPage , defaultPage , getCopies , getJobName , getPrintService , getPrinterJob , getUserName , isCancelled , lookupPrintServices , lookupStreamPrintServices , pageDialog , pageDialog , print , print , printDialog , printDialog , setCopies , setJobName , setPageable , setPrintService , setPrintable , setPrintable , validatePage |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public void cancel()
Cancels an in progress print job.
- Overrides:
- cancel in interface PrinterJob
public PageFormat defaultPage(PageFormat page_format)
Clones the specifiedPageFormat
object then alters the clone so that it represents the default page format.
- Overrides:
- defaultPage in interface PrinterJob
- Parameters:
page_format
- ThePageFormat
to clone.
- Returns:
- A new default page format.
public int getCopies()
Returns the number of copies to be printed.
- Overrides:
- getCopies in interface PrinterJob
- Returns:
- The number of copies to be printed.
public String getJobName()
Returns the name of the print job.
- Overrides:
- getJobName in interface PrinterJob
- Returns:
- The name of the print job.
public String getUserName()
Returns the printing user name.
- Overrides:
- getUserName in interface PrinterJob
- Returns:
- The printing username.
public boolean isCancelled()
Tests whether or not this job has been cancelled.
- Overrides:
- isCancelled in interface PrinterJob
- Returns:
true
if this job has been cancelled,false
otherwise.
public PageFormat pageDialog(PageFormat page_format) throws HeadlessException
Displays a dialog box to the user which allows the page format attributes to be modified.
- Overrides:
- pageDialog in interface PrinterJob
- Parameters:
page_format
- ThePageFormat
object to modify.
- Returns:
- The modified
PageFormat
.
public void print() throws PrinterException
Prints the pages.
- Overrides:
- print in interface PrinterJob
public void print(PrintRequestAttributeSet attributes) throws PrinterException
Prints the page with given attributes.
- Overrides:
- print in interface PrinterJob
public boolean printDialog() throws HeadlessException
Displays a dialog box to the user which allows the print job attributes to be modified.
- Overrides:
- printDialog in interface PrinterJob
- Returns:
false
if the user cancels the dialog box,true
otherwise.
public boolean printDialog(PrintRequestAttributeSet attributes) throws HeadlessException
Displays a dialog box to the user which allows the print job attributes to be modified.
- Overrides:
- printDialog in interface PrinterJob
- Returns:
false
if the user cancels the dialog box,true
otherwise.
public void setCopies(int copies)
Sets the number of copies to be printed.
- Overrides:
- setCopies in interface PrinterJob
- Parameters:
copies
- The number of copies to be printed.
public void setJobName(String job_name)
Sets the name of the print job.
- Overrides:
- setJobName in interface PrinterJob
- Parameters:
job_name
- The name of the print job.
public void setPageable(Pageable pageable)
This sets the pages that are to be printed.
- Overrides:
- setPageable in interface PrinterJob
- Parameters:
pageable
- The pages to be printed, which may not benull
.
public void setPrintService(PrintService service) throws PrinterException
Change the printer for this print job to service. Subclasses that support setting the print service override this method. Throws PrinterException when the class doesn't support setting the printer, the service doesn't support Pageable or Printable interfaces for 2D print output.
- Overrides:
- setPrintService in interface PrinterJob
- Parameters:
service
- The new printer to use.
- Throws:
PrinterException
- if service is not valid.
public void setPrintable(Printable printable)
Sets this specifiedPrintable
as the one to use for rendering the pages on the print device.
- Overrides:
- setPrintable in interface PrinterJob
- Parameters:
printable
- ThePrintable
for the print job.
public void setPrintable(Printable printable, PageFormat page_format)
Sets thePrintable
and the page format for the pages to be printed.
- Overrides:
- setPrintable in interface PrinterJob
- Parameters:
printable
- ThePrintable
for the print job.page_format
- ThePageFormat
for the print job.
public PageFormat validatePage(PageFormat page_format)
Makes any alterations to the specifiedPageFormat
necessary to make it work with the current printer. The alterations are made to a clone of the input object, which is then returned.
- Overrides:
- validatePage in interface PrinterJob
- Parameters:
page_format
- ThePageFormat
to validate.
- Returns:
- The validated
PageFormat
.