30 import javax.print.attribute.PrintServiceAttributeSet; 31 32 /** 33 * 34 * Class PrintServiceAttributeEvent encapsulates an event a 35 * Print Service instance reports to let the client know of 36 * changes in the print service state. 37 */ 38 39 public class PrintServiceAttributeEvent extends PrintEvent { 40 41 private static final long serialVersionUID = -7565987018140326600L; 42 43 private PrintServiceAttributeSet attributes; 44 45 /** 46 * Constructs a PrintServiceAttributeEvent object. 47 * 48 * @param source the print job generating this event 49 * @param attributes the attribute changes being reported 50 * @throws IllegalArgumentException if <code>source</code> is 51 * <code>null</code>. 52 */ 53 public PrintServiceAttributeEvent(PrintService source, 54 PrintServiceAttributeSet attributes) { 55 56 super(source); 57 this.attributes = AttributeSetUtilities.unmodifiableView(attributes); 58 } 59 60 61 /** 62 * Returns the print service. 63 64 * @return Print Service object. 65 */ 66 public PrintService getPrintService() { 67 68 return (PrintService) getSource(); 69 } 70 71 | 30 import javax.print.attribute.PrintServiceAttributeSet; 31 32 /** 33 * 34 * Class PrintServiceAttributeEvent encapsulates an event a 35 * Print Service instance reports to let the client know of 36 * changes in the print service state. 37 */ 38 39 public class PrintServiceAttributeEvent extends PrintEvent { 40 41 private static final long serialVersionUID = -7565987018140326600L; 42 43 private PrintServiceAttributeSet attributes; 44 45 /** 46 * Constructs a PrintServiceAttributeEvent object. 47 * 48 * @param source the print job generating this event 49 * @param attributes the attribute changes being reported 50 * @throws IllegalArgumentException if {@code source} is 51 * {@code null}. 52 */ 53 public PrintServiceAttributeEvent(PrintService source, 54 PrintServiceAttributeSet attributes) { 55 56 super(source); 57 this.attributes = AttributeSetUtilities.unmodifiableView(attributes); 58 } 59 60 61 /** 62 * Returns the print service. 63 64 * @return Print Service object. 65 */ 66 public PrintService getPrintService() { 67 68 return (PrintService) getSource(); 69 } 70 71 |