1. /*
  2. * @(#)PrintServiceAttributeEvent.java 1.3 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.print.event;
  8. import java.util.List;
  9. import javax.print.PrintService;
  10. import javax.print.attribute.AttributeSetUtilities;
  11. import javax.print.attribute.PrintServiceAttributeSet;
  12. /**
  13. *
  14. * Class PrintServiceAttributeEvent encapsulates an event a
  15. * Print Service instance reports to let the client know of
  16. * changes in the print service state.
  17. */
  18. public class PrintServiceAttributeEvent extends PrintEvent {
  19. private PrintServiceAttributeSet attributes;
  20. /**
  21. * Constructs a PrintServiceAttributeEvent object.
  22. *
  23. * @param source the print job generating this event
  24. * @param attributes the attribute changes being reported
  25. */
  26. public PrintServiceAttributeEvent(PrintService source,
  27. PrintServiceAttributeSet attributes) {
  28. super(source);
  29. this.attributes = AttributeSetUtilities.unmodifiableView(attributes);
  30. }
  31. /**
  32. * Returns the print service.
  33. * @return Print Service object.
  34. */
  35. public PrintService getPrintService() {
  36. return (PrintService) getSource();
  37. }
  38. /**
  39. * Determine the printing service attributes that changed and their new
  40. * values.
  41. *
  42. * @return Attributes containing the new values for the service
  43. * attributes that changed. The returned set may be unmodifiable.
  44. */
  45. public PrintServiceAttributeSet getAttributes() {
  46. return attributes;
  47. }
  48. }