APIdia Launch Partner
Top Fields Constructors Methods
sun.print

public Class PSStreamPrintJob

extends Object
implements CancelablePrintJob
Class Inheritance
All Implemented Interfaces
javax.print.CancelablePrintJob, javax.print.DocPrintJob
Imports
java.net.URL, java.io.InputStream, .IOException, .Reader, java.util.ArrayList, javax.print.CancelablePrintJob, .Doc, .DocFlavor, .PrintService, .PrintException, javax.print.event.PrintJobEvent, .PrintJobListener, .PrintJobAttributeListener, javax.print.attribute.Attribute, .AttributeSetUtilities, .DocAttributeSet, .HashPrintJobAttributeSet, .HashPrintRequestAttributeSet, .PrintJobAttribute, .PrintJobAttributeSet, .PrintRequestAttribute, .PrintRequestAttributeSet, javax.print.attribute.standard.Copies, .DocumentName, .Fidelity, .JobName, .JobOriginatingUserName, .Media, .MediaSize, .MediaSizeName, .OrientationRequested, .RequestingUserName, java.awt.print.*

Field Summary

Modifier and TypeField and Description
private transient ArrayList<PrintJobAttributeListener>
private int
private Doc
private boolean
private InputStream
private PrinterJob
private PrintJobAttributeSet
private transient ArrayList<PrintJobListener>
private String
private transient ArrayList<PrintJobAttributeSet>
private MediaSize
private OrientationRequested
private boolean
private boolean
private Reader
private PrintRequestAttributeSet
private PSStreamPrintService

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addPrintJobAttributeListener(PrintJobAttributeListener listener, PrintJobAttributeSet attributes)

Implements javax.print.DocPrintJob.addPrintJobAttributeListener.

Registers a listener for changes in the specified attributes.

public void
addPrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.addPrintJobListener.

Registers a listener for event occurring during this print job.

public void
cancel()

Implements javax.print.CancelablePrintJob.cancel.

Stops further processing of a print job.

private void
public PrintJobAttributeSet
getAttributes()

Implements javax.print.DocPrintJob.getAttributes.

Obtains this Print Job's set of printing attributes.

private void
public PrintService
getPrintService()

Implements javax.print.DocPrintJob.getPrintService.

Determines the PrintService object to which this print job object is bound.

private synchronized void
private void
notifyEvent(int reason)

public void
public void
public void
removePrintJobAttributeListener(PrintJobAttributeListener listener)

Implements javax.print.DocPrintJob.removePrintJobAttributeListener.

Removes an attribute listener from this print job.

public void
removePrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.removePrintJobListener.

Removes a listener from this print job.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attrListenersback to summary
private transient ArrayList<PrintJobAttributeListener> attrListeners
copiesback to summary
private int copies
docback to summary
private Doc doc
fidelityback to summary
private boolean fidelity
instreamback to summary
private InputStream instream
jobback to summary
private PrinterJob job
jobAttrSetback to summary
private PrintJobAttributeSet jobAttrSet
jobListenersback to summary
private transient ArrayList<PrintJobListener> jobListeners
jobNameback to summary
private String jobName
listenedAttributeSetsback to summary
private transient ArrayList<PrintJobAttributeSet> listenedAttributeSets
mediaSizeback to summary
private MediaSize mediaSize
orientback to summary
private OrientationRequested orient
printingback to summary
private boolean printing
printReturnedback to summary
private boolean printReturned
readerback to summary
private Reader reader
reqAttrSetback to summary
private PrintRequestAttributeSet reqAttrSet
serviceback to summary
private PSStreamPrintService service

Constructor Detail

PSStreamPrintJobback to summary
pack-priv PSStreamPrintJob(PSStreamPrintService service)

Method Detail

addPrintJobAttributeListenerback to summary
public void addPrintJobAttributeListener(PrintJobAttributeListener listener, PrintJobAttributeSet attributes)

Implements javax.print.DocPrintJob.addPrintJobAttributeListener.

Doc from javax.print.DocPrintJob.addPrintJobAttributeListener.

Registers a listener for changes in the specified attributes. If listener is null, no exception is thrown and no action is performed. To determine the attribute updates that may be reported by this job, a client can call getAttributes() and identify the subset that are interesting and likely to be reported to the listener. Clients expecting to be updated about changes in a specific job attribute should verify it is in that set, but updates about an attribute will be made only if it changes and this is detected by the job. Also updates may be subject to batching by the job. To minimize overhead in print job processing it is recommended to listen on only that subset of attributes which are likely to change. If the specified set is empty no attribute updates will be reported to the listener. If the attribute set is null, then this means to listen on all dynamic attributes that the job supports. This may result in no update notifications if a job can not report any attribute updates.

If listener is already registered, it will be registered again.

addPrintJobListenerback to summary
public void addPrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.addPrintJobListener.

Doc from javax.print.DocPrintJob.addPrintJobListener.

Registers a listener for event occurring during this print job. If listener is null, no exception is thrown and no action is performed. If listener is already registered, it will be registered again.

cancelback to summary
public void cancel() throws PrintException

Implements javax.print.CancelablePrintJob.cancel.

Doc from javax.print.CancelablePrintJob.cancel.

Stops further processing of a print job.

If a service supports this method it cannot be concluded that job cancellation will always succeed. A job may not be able to be cancelled once it has reached and passed some point in its processing. A successful cancellation means only that the entire job was not printed, some portion may already have printed when cancel returns.

The service will throw a PrintException if the cancellation did not succeed. A job which has not yet been submitted for printing should throw this exception. Cancelling an already successfully cancelled Print Job is not considered an error and will always succeed.

Cancellation in some services may be a lengthy process, involving requests to a server and processing of its print queue. Clients may wish to execute cancel in a thread which does not affect application execution.

Exceptions
PrintException:
if the job could not be successfully cancelled
closeDataStreamsback to summary
private void closeDataStreams()
getAttributesback to summary
public PrintJobAttributeSet getAttributes()

Implements javax.print.DocPrintJob.getAttributes.

Doc from javax.print.DocPrintJob.getAttributes.

Obtains this Print Job's set of printing attributes. The returned attribute set object is unmodifiable. The returned attribute set object is a "snapshot" of this Print Job's attribute set at the time of the getAttributes() method call; that is, the returned attribute set's object's contents will not be updated if this Print Job's attribute set's contents change in the future. To detect changes in attribute values, call getAttributes() again and compare the new attribute set to the previous attribute set; alternatively, register a listener for print job events. The returned value may be an empty set but should not be null.

getAttributeValuesback to summary
private void getAttributeValues(DocFlavor flavor) throws PrintException
getPrintServiceback to summary
public PrintService getPrintService()

Implements javax.print.DocPrintJob.getPrintService.

Doc from javax.print.DocPrintJob.getPrintService.

Determines the PrintService object to which this print job object is bound.

initializeAttributeSetsback to summary
private synchronized void initializeAttributeSets(Doc doc, PrintRequestAttributeSet reqSet)
notifyEventback to summary
private void notifyEvent(int reason)
pageableJobback to summary
public void pageableJob(Pageable pageable, PrintRequestAttributeSet attributes) throws PrintException
printableJobback to summary
public void printableJob(Printable printable, PrintRequestAttributeSet attributes) throws PrintException
removePrintJobAttributeListenerback to summary
public void removePrintJobAttributeListener(PrintJobAttributeListener listener)

Implements javax.print.DocPrintJob.removePrintJobAttributeListener.

Doc from javax.print.DocPrintJob.removePrintJobAttributeListener.

Removes an attribute listener from this print job. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this print job. If the listener is null, no exception is thrown and no action is performed. If a listener is registered more than once, even for a different set of attributes, no guarantee is made which listener is removed.

removePrintJobListenerback to summary
public void removePrintJobListener(PrintJobListener listener)

Implements javax.print.DocPrintJob.removePrintJobListener.

Doc from javax.print.DocPrintJob.removePrintJobListener.

Removes a listener from this print job. This method performs no function, nor does it throw an exception, if the listener specified by the argument was not previously added to this print job. If listener is null, no exception is thrown and no action is performed. If a listener was registered more than once only one of the registrations will be removed.