Class PrintJobEvent
java.lang.Object
java.util.EventObject
javax.print.event.PrintEvent
javax.print.event.PrintJobEvent
- All Implemented Interfaces:
Serializable
Class
PrintJobEvent encapsulates common events a print job reports to
let a listener know of progress in the processing of the DocPrintJob.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe job is not necessarily printed yet, but the data has been transferred successfully from the client to the print service.static final intThe job was canceled by thePrintService.static final intThe document is completely printed.static final intThe print service reports that the job cannot be completed.static final intNot all print services may be capable of delivering interesting events, or even telling when a job is complete.static final intThe print service indicates that a - possibly transient - problem may require external intervention before the print service can continue.Fields declared in class EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionPrintJobEvent(DocPrintJob source, int reason) Constructs aPrintJobEventobject. -
Method Summary
Modifier and TypeMethodDescriptionintGets the reason for this event.Determines theDocPrintJobto which this print job event pertains.Methods declared in class PrintEvent
toStringMethods declared in class EventObject
getSourceMethods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Field Details
-
JOB_CANCELED
-
JOB_COMPLETE
public static final int JOB_COMPLETEThe document is completely printed.- See Also:
-
JOB_FAILED
public static final int JOB_FAILEDThe print service reports that the job cannot be completed. The application must resubmit the job.- See Also:
-
REQUIRES_ATTENTION
public static final int REQUIRES_ATTENTIONThe print service indicates that a - possibly transient - problem may require external intervention before the print service can continue. One example of an event that can generate this message is when the printer runs out of paper.- See Also:
-
NO_MORE_EVENTS
public static final int NO_MORE_EVENTSNot all print services may be capable of delivering interesting events, or even telling when a job is complete. This message indicates the print job has no further information or communication with the print service. This message should always be delivered if a terminal event (completed/failed/canceled) is not delivered. For example, if messages such asJOB_COMPLETEhave NOT been received before receiving this message, the only inference that should be drawn is that the print service does not support delivering such an event.- See Also:
-
DATA_TRANSFER_COMPLETE
public static final int DATA_TRANSFER_COMPLETEThe job is not necessarily printed yet, but the data has been transferred successfully from the client to the print service. The client may free data resources.- See Also:
-
-
Constructor Details
-
PrintJobEvent
Constructs aPrintJobEventobject.- Parameters:
source- aDocPrintJobobjectreason- an int specifying the reason- Throws:
IllegalArgumentException- ifsourceisnull
-
-
Method Details
-
getPrintEventType
public int getPrintEventType()Gets the reason for this event.- Returns:
- reason int
-
getPrintJob
Determines theDocPrintJobto which this print job event pertains.- Returns:
- the
DocPrintJobobject that represents the print job that reports the events encapsulated by thisPrintJobEvent
-