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