KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)PrintServiceAttributeEvent.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 java.util.List JavaDoc;
11 import javax.print.PrintService JavaDoc;
12 import javax.print.attribute.AttributeSetUtilities JavaDoc;
13 import javax.print.attribute.PrintServiceAttributeSet JavaDoc;
14
15 /**
16  *
17  * Class PrintServiceAttributeEvent encapsulates an event a
18  * Print Service instance reports to let the client know of
19  * changes in the print service state.
20  */

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

36     public PrintServiceAttributeEvent(PrintService JavaDoc source,
37                                       PrintServiceAttributeSet JavaDoc attributes) {
38
39         super(source);
40         this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
41     }
42
43
44     /**
45      * Returns the print service.
46
47      * @return Print Service object.
48      */

49     public PrintService JavaDoc getPrintService() {
50  
51         return (PrintService JavaDoc) getSource();
52     }
53
54
55     /**
56      * Determine the printing service attributes that changed and their new
57      * values.
58      *
59      * @return Attributes containing the new values for the service
60      * attributes that changed. The returned set may be unmodifiable.
61      */

62     public PrintServiceAttributeSet JavaDoc getAttributes() {
63
64     return attributes;
65     }
66
67 }
68
Popular Tags