KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > event > PrintJobAttributeEvent


1 /*
2  * @(#)PrintJobAttributeEvent.java 1.6 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.print.event;
9
10 import javax.print.DocPrintJob JavaDoc;
11 import javax.print.attribute.AttributeSetUtilities JavaDoc;
12 import javax.print.attribute.PrintJobAttributeSet JavaDoc;
13
14 /**
15  * Class PrintJobAttributeEvent encapsulates an event a PrintService
16  * reports to let the client know that one or more printing attributes for a
17  * PrintJob have changed.
18  */

19
20 public class PrintJobAttributeEvent extends PrintEvent JavaDoc {
21
22     private static final long serialVersionUID = -6534469883874742101L;
23
24     private PrintJobAttributeSet JavaDoc attributes;
25     
26     /**
27      * Constructs a PrintJobAttributeEvent object.
28      * @param source the print job generating this event
29      * @param attributes the attribute changes being reported
30      * @throws IllegalArgumentException if <code>source</code> is
31      * <code>null</code>.
32      */

33     public PrintJobAttributeEvent (DocPrintJob JavaDoc source,
34                                    PrintJobAttributeSet JavaDoc attributes) {
35     super(source);
36
37         this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
38     }
39
40
41     /**
42      * Determine the Print Job to which this print job event pertains.
43      *
44      * @return Print Job object.
45      */

46     public DocPrintJob JavaDoc getPrintJob() {
47
48         return (DocPrintJob JavaDoc) getSource();
49     }
50
51
52     /**
53      * Determine the printing attributes that changed and their new values.
54      *
55      * @return Attributes containing the new values for the print job
56      * attributes that changed. The returned set may not be modifiable.
57      */

58     public PrintJobAttributeSet JavaDoc getAttributes() {
59
60     return attributes;
61
62     }
63
64 }
65
Popular Tags