Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.awt.print.PrinterJob

java.lang.Object
    |
    +----java.awt.print.PrinterJob

public abstract class PrinterJob
extends Object

Constructor Summary
 PrinterJob()
 
 

Method Summary
PageFormat  defaultPage(PageFormat page)
The passed in PageFormat will be altered to describe the default page size and orientation of the PrinterJob's current printer.
void  endDoc()
Called by the print() method at the end of a print job.
int  getCollatedCopies()
Returns how many times the entire book should be printed by the PrintJob.
int  getCopies()
Get the number of copies to be printed.
int  getFirstPage()
Return the zero based index of the first page to be printed in this job.
int  getLastPage()
Return the zero based index of the last page to be printed in this job.
int  getNoncollatedCopies()
Returns how many times each page in the book should be consecutively printed by PrintJob.
Enumeration  getPropertyNames()
Return an array of the keys for the properties in this PrinterJob.
String  getPropertyString(String key)
Return the string value of the PrinterJob property identified by 'key'.
boolean  isCollated()
Return true if collated copies will be printed.
void  print(Pageable document)
Prints a set of pages from a Pageable object.
void  printPage(PageContext page, int pageIndex)
Images a page to the printer.
void  setCollated(boolean collate)
Set whether copies should be collated or not.
void  setCopies(int copies)
Set the number of copies to be printed.
void  setPageRange(int firstPage, int lastPage)
Set the range of pages from a Book to be printed.
void  setPropertyString(String key, String value)
Set the String value of the property string identified by 'key'.
boolean  setup(Pageable doc)
The user is presented with a dialog through which print time settings can be requested.
void  startDoc()
Called by the print() method at the start of a print job.
PageFormat  validatePage(PageFormat page)
The passed in PageFormat is altered to be usable on the PrinterJob's current printer.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrinterJob

public PrinterJob()
Method Detail

print

public void print(Pageable document) throws IOException
Prints a set of pages from a Pageable object. The Pageable object is queried for page format and page painter for each page to be drawn. The page painter, an implementor of the Printable interface is then asked to draw the page.

setup

public abstract boolean setup(Pageable doc)
The user is presented with a dialog through which print time settings can be requested. These settings are stored in the PrinterJob. If the user okays the dialog, then true is returned. If the dialog is canceled then false is returned.

defaultPage

public abstract PageFormat defaultPage(PageFormat page)
The passed in PageFormat will be altered to describe the default page size and orientation of the PrinterJob's current printer.

validatePage

public abstract PageFormat validatePage(PageFormat page)
The passed in PageFormat is altered to be usable on the PrinterJob's current printer.

getPropertyString

public abstract String getPropertyString(String key) throws PrintPropertyException
Return the string value of the PrinterJob property identified by 'key'.

setPropertyString

public abstract void setPropertyString(String key,
                                       String value) throws PrintPropertyException
Set the String value of the property string identified by 'key'.

getPropertyNames

public abstract Enumeration getPropertyNames()
Return an array of the keys for the properties in this PrinterJob.

setPageRange

public void setPageRange(int firstPage,
                         int lastPage)
Set the range of pages from a Book to be printed. Both 'firstPage' and 'lastPage' are zero based page indices. If either parameter is less than zero then the page range is set to be from the first page to the last.

getFirstPage

public int getFirstPage()
Return the zero based index of the first page to be printed in this job.

getLastPage

public int getLastPage()
Return the zero based index of the last page to be printed in this job.

setCopies

public void setCopies(int copies)
Set the number of copies to be printed.

getCopies

public int getCopies()
Get the number of copies to be printed.

setCollated

public void setCollated(boolean collate)
Set whether copies should be collated or not. Two collated copies of a three page document print in this order: 1, 2, 3, 1, 2, 3 while uncollated copies print in this order: 1, 1, 2, 2, 3, 3.

isCollated

public boolean isCollated()
Return true if collated copies will be printed.

startDoc

protected abstract void startDoc() throws IOException
Called by the print() method at the start of a print job.

endDoc

protected abstract void endDoc() throws IOException
Called by the print() method at the end of a print job.

printPage

protected abstract void printPage(PageContext page,
                                  int pageIndex) throws IOException
Images a page to the printer.

getCollatedCopies

protected int getCollatedCopies()
Returns how many times the entire book should be printed by the PrintJob. If the printer itself supports collation then this method should return 1 indicating that the entire book need only be printed once and the copies will be collated and made in the printer.

getNoncollatedCopies

protected int getNoncollatedCopies()
Returns how many times each page in the book should be consecutively printed by PrintJob. If the printer makes copies itself then this method should return 1.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.