KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > PrintJob


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
8 package java.awt;
9
10 /**
11  * An abstract class which initiates and executes a print job.
12  * It provides access to a print graphics object which renders
13  * to an appropriate print device.
14  *
15  * @see Toolkit#getPrintJob
16  *
17  * @version 1.13 12/19/03
18  * @author Amy Fowler
19  */

20 public abstract class PrintJob {
21
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 JavaDoc getGraphics();
30
31     /**
32      * Returns the dimensions of the page in pixels.
33      * The resolution of the page is chosen so that it
34      * is similar to the screen resolution.
35      */

36     public abstract Dimension JavaDoc getPageDimension();
37
38     /**
39      * Returns the resolution of the page in pixels per inch.
40      * Note that this doesn't have to correspond to the physical
41      * resolution of the printer.
42      */

43     public abstract int getPageResolution();
44
45     /**
46      * Returns true if the last page will be printed first.
47      */

48     public abstract boolean lastPageFirst();
49
50     /**
51      * Ends the print job and does any necessary cleanup.
52      */

53     public abstract void end();
54
55     /**
56      * Ends this print job once it is no longer referenced.
57      * @see #end
58      */

59     public void finalize() {
60     end();
61     }
62
63 }
64
Popular Tags