< prev index next >

src/java.desktop/share/classes/javax/print/event/PrintJobAttributeEvent.java

Print this page




  28 import javax.print.DocPrintJob;
  29 import javax.print.attribute.AttributeSetUtilities;
  30 import javax.print.attribute.PrintJobAttributeSet;
  31 
  32 /**
  33  * Class PrintJobAttributeEvent encapsulates an event a PrintService
  34  * reports to let the client know that one or more printing attributes for a
  35  * PrintJob have changed.
  36  */
  37 
  38 public class PrintJobAttributeEvent extends PrintEvent {
  39 
  40     private static final long serialVersionUID = -6534469883874742101L;
  41 
  42     private PrintJobAttributeSet attributes;
  43 
  44     /**
  45      * Constructs a PrintJobAttributeEvent object.
  46      * @param source the print job generating  this event
  47      * @param attributes the attribute changes being reported
  48      * @throws IllegalArgumentException if <code>source</code> is
  49      *         <code>null</code>.
  50      */
  51     public PrintJobAttributeEvent (DocPrintJob source,
  52                                    PrintJobAttributeSet attributes)  {
  53         super(source);
  54 
  55         this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
  56     }
  57 
  58 
  59     /**
  60      * Determine the Print Job to which this print job event pertains.
  61      *
  62      * @return  Print Job object.
  63      */
  64     public DocPrintJob getPrintJob() {
  65 
  66         return (DocPrintJob) getSource();
  67     }
  68 
  69 


  28 import javax.print.DocPrintJob;
  29 import javax.print.attribute.AttributeSetUtilities;
  30 import javax.print.attribute.PrintJobAttributeSet;
  31 
  32 /**
  33  * Class PrintJobAttributeEvent encapsulates an event a PrintService
  34  * reports to let the client know that one or more printing attributes for a
  35  * PrintJob have changed.
  36  */
  37 
  38 public class PrintJobAttributeEvent extends PrintEvent {
  39 
  40     private static final long serialVersionUID = -6534469883874742101L;
  41 
  42     private PrintJobAttributeSet attributes;
  43 
  44     /**
  45      * Constructs a PrintJobAttributeEvent object.
  46      * @param source the print job generating  this event
  47      * @param attributes the attribute changes being reported
  48      * @throws IllegalArgumentException if {@code source} is
  49      *         {@code null}.
  50      */
  51     public PrintJobAttributeEvent (DocPrintJob source,
  52                                    PrintJobAttributeSet attributes)  {
  53         super(source);
  54 
  55         this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
  56     }
  57 
  58 
  59     /**
  60      * Determine the Print Job to which this print job event pertains.
  61      *
  62      * @return  Print Job object.
  63      */
  64     public DocPrintJob getPrintJob() {
  65 
  66         return (DocPrintJob) getSource();
  67     }
  68 
  69 
< prev index next >