1. /*
  2. * @(#)PrintJob.java 1.13 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. package java.awt;
  8. /**
  9. * An abstract class which initiates and executes a print job.
  10. * It provides access to a print graphics object which renders
  11. * to an appropriate print device.
  12. *
  13. * @see Toolkit#getPrintJob
  14. *
  15. * @version 1.13 12/19/03
  16. * @author Amy Fowler
  17. */
  18. public abstract class PrintJob {
  19. /**
  20. * Gets a Graphics object that will draw to the next page.
  21. * The page is sent to the printer when the graphics
  22. * object is disposed. This graphics object will also implement
  23. * the PrintGraphics interface.
  24. * @see PrintGraphics
  25. */
  26. public abstract Graphics getGraphics();
  27. /**
  28. * Returns the dimensions of the page in pixels.
  29. * The resolution of the page is chosen so that it
  30. * is similar to the screen resolution.
  31. */
  32. public abstract Dimension getPageDimension();
  33. /**
  34. * Returns the resolution of the page in pixels per inch.
  35. * Note that this doesn't have to correspond to the physical
  36. * resolution of the printer.
  37. */
  38. public abstract int getPageResolution();
  39. /**
  40. * Returns true if the last page will be printed first.
  41. */
  42. public abstract boolean lastPageFirst();
  43. /**
  44. * Ends the print job and does any necessary cleanup.
  45. */
  46. public abstract void end();
  47. /**
  48. * Ends this print job once it is no longer referenced.
  49. * @see #end
  50. */
  51. public void finalize() {
  52. end();
  53. }
  54. }