|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.print.PrinterJob
The PrinterJob
class is the principal class that controls
printing. An application calls methods in this class to set up a job,
optionally to invoke a print dialog with the user, and then to print
the pages of the job.
Constructor Summary | |
PrinterJob()
A PrinterJob object should be created using the
static getPrinterJob method. |
Method Summary | |
abstract void |
cancel()
Cancels a print job that is in progress. |
PageFormat |
defaultPage()
Creates a new PageFormat instance and
sets it to a default size and orientation. |
abstract PageFormat |
defaultPage(PageFormat page)
Clones the PageFormat argument and alters the
clone to describe a default page size and orientation. |
abstract int |
getCopies()
Gets the number of copies to be printed. |
abstract String |
getJobName()
Gets the name of the document to be printed. |
static PrinterJob |
getPrinterJob()
Creates and returns a PrinterJob . |
abstract String |
getUserName()
Gets the name of the printing user. |
abstract boolean |
isCancelled()
Returns true if a print job is
in progress, but is going to be cancelled
at the next opportunity; otherwise returns
false . |
abstract PageFormat |
pageDialog(PageFormat page)
Displays a dialog that allows modification of a PageFormat instance. |
abstract void |
print()
Prints a set of pages. |
abstract boolean |
printDialog()
Presents a dialog to the user for changing the properties of the print job. |
abstract void |
setCopies(int copies)
Sets the number of copies to be printed. |
abstract void |
setJobName(String jobName)
Sets the name of the document to be printed. |
abstract void |
setPageable(Pageable document)
Queries document for the number of pages and
the PageFormat and Printable for each
page held in the Pageable instance,
document . |
abstract void |
setPrintable(Printable painter)
Calls painter to render the pages. |
abstract void |
setPrintable(Printable painter,
PageFormat format)
Calls painter to render the pages in the specified
format . |
abstract PageFormat |
validatePage(PageFormat page)
Alters the PageFormat argument to be usable on
this PrinterJob object's current printer. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public PrinterJob()
PrinterJob
object should be created using the
static getPrinterJob
method.Method Detail |
public static PrinterJob getPrinterJob()
PrinterJob
.PrinterJob
.public abstract void setPrintable(Printable painter)
painter
to render the pages. The pages in the
document to be printed by this
PrinterJob
are rendered by the Printable
object, painter
. The PageFormat
for each page
is the default page format.painter
- the Printable
that renders each page of
the document.public abstract void setPrintable(Printable painter, PageFormat format)
painter
to render the pages in the specified
format
. The pages in the document to be printed by
this PrinterJob
are rendered by the
Printable
object, painter
. The
PageFormat
of each page is format
.painter
- the Printable
called to render
each page of the documentformat
- the size and orientation of each page to
be printedpublic abstract void setPageable(Pageable document) throws NullPointerException
document
for the number of pages and
the PageFormat
and Printable
for each
page held in the Pageable
instance,
document
.document
- the pages to be printed. It can not be
null
.Pageable
passed in
was null
.PageFormat
,
Printable
public abstract boolean printDialog()
true
if the user does not cancel the dialog;
false
otherwise.public abstract PageFormat pageDialog(PageFormat page)
PageFormat
instance.
The page
argument is used to initialize controls
in the page setup dialog.
If the user cancels the dialog then this method returns the
original page
object unmodified.
If the user okays the dialog then this method returns a new
PageFormat
object with the indicated changes.
In either case, the original page
object is
not modified.page
- the default PageFormat
presented to the
user for modificationpage
object if the dialog
is cancelled; a new PageFormat
object
containing the format indicated by the user if the
dialog is acknowledged.public abstract PageFormat defaultPage(PageFormat page)
PageFormat
argument and alters the
clone to describe a default page size and orientation.page
- the PageFormat
to be cloned and alteredpage
, altered to describe a default
PageFormat
.public PageFormat defaultPage()
PageFormat
instance and
sets it to a default size and orientation.PageFormat
set to a default size and
orientation.public abstract PageFormat validatePage(PageFormat page)
PageFormat
argument to be usable on
this PrinterJob
object's current printer.page
- this page description is cloned and then its settings
are altered to be usuable for this
PrinterJob
PageFormat
that is cloned from
the PageFormat
parameter and altered
to conform with this PrinterJob
.public abstract void print() throws PrinterException
Book
,
Pageable
,
Printable
public abstract void setCopies(int copies)
copies
- the number of copies to be printedpublic abstract int getCopies()
public abstract String getUserName()
public abstract void setJobName(String jobName)
null
.jobName
- the name of the document to be printedpublic abstract String getJobName()
public abstract void cancel()
public abstract boolean isCancelled()
true
if a print job is
in progress, but is going to be cancelled
at the next opportunity; otherwise returns
false
.true
if the job in progress
is going to be cancelled; false
otherwise.
|
Java Platform 1.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |