1 |
/* PrintJob.java -- A print job class |
/* PrintJob.java -- A print job class |
2 |
Copyright (C) 1999 Free Software Foundation, Inc. |
Copyright (C) 1999, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
39 |
package java.awt; |
package java.awt; |
40 |
|
|
41 |
/** |
/** |
42 |
* This abstract class represents a print job. |
* This abstract class represents a print job. |
43 |
* |
* |
44 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn <arenn@urbanophile.com> |
45 |
*/ |
* @see Toolkit#getPrintJob(Frame, String, Properties) |
46 |
public abstract class PrintJob |
* @since 1.0 |
47 |
{ |
* @status updated to 1.4 |
|
|
|
|
/* |
|
|
* Constructors |
|
48 |
*/ |
*/ |
49 |
|
public abstract class PrintJob |
|
/** |
|
|
* This method initializes a new instance of <code>PrintJob</code>. |
|
|
*/ |
|
|
public |
|
|
PrintJob() |
|
|
{ |
|
|
} |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/* |
|
|
* Instance Methods |
|
|
*/ |
|
|
|
|
|
/** |
|
|
* Returns a graphics context suitable for rendering the next page. |
|
|
* |
|
|
* @return A graphics context for printing the next page. |
|
|
*/ |
|
|
public abstract Graphics |
|
|
getGraphics(); |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* Returns the dimension of the page in pixels. The resolution will be |
|
|
* chosen to be similar to the on screen image. |
|
|
* |
|
|
* @return The page dimensions. |
|
|
*/ |
|
|
public abstract Dimension |
|
|
getPageDimension(); |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* Returns the resolution of the page in pixels per inch. |
|
|
* |
|
|
* @return The resolution of the page in pixels per inch. |
|
|
*/ |
|
|
public abstract int |
|
|
getPageResolution(); |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* Tests whether or not the last page will be printed first. |
|
|
* |
|
|
* @return <code>true</code> if the last page prints first, <code>false</code> |
|
|
* otherwise. |
|
|
*/ |
|
|
public abstract boolean |
|
|
lastPageFirst(); |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* Informs the print job that printing is complete. |
|
|
*/ |
|
|
public abstract void |
|
|
end(); |
|
|
|
|
|
/*************************************************************************/ |
|
|
|
|
|
/** |
|
|
* This method explicitly ends the print job in the event the job |
|
|
* becomes un-referenced without the application having done so. |
|
|
*/ |
|
|
public void |
|
|
finalize() |
|
50 |
{ |
{ |
51 |
end(); |
/** |
52 |
} |
* Create a new PrintJob. |
53 |
|
*/ |
54 |
|
public PrintJob() |
55 |
|
{ |
56 |
|
} |
57 |
|
|
58 |
|
/** |
59 |
|
* Returns a graphics context suitable for rendering the next page. The |
60 |
|
* return must also implement {@link PrintGraphics}. |
61 |
|
* |
62 |
|
* @return a graphics context for printing the next page |
63 |
|
*/ |
64 |
|
public abstract Graphics getGraphics(); |
65 |
|
|
66 |
|
/** |
67 |
|
* Returns the dimension of the page in pixels. The resolution will be |
68 |
|
* chosen to be similar to the on screen image. |
69 |
|
* |
70 |
|
* @return the page dimensions |
71 |
|
*/ |
72 |
|
public abstract Dimension getPageDimension(); |
73 |
|
|
74 |
|
/** |
75 |
|
* Returns the resolution of the page in pixels per inch. Note that this is |
76 |
|
* not necessarily the printer's resolution. |
77 |
|
* |
78 |
|
* @return the resolution of the page in pixels per inch |
79 |
|
*/ |
80 |
|
public abstract int getPageResolution(); |
81 |
|
|
82 |
|
/** |
83 |
|
* Tests whether or not the last page will be printed first. |
84 |
|
* |
85 |
|
* @return true if the last page prints first |
86 |
|
*/ |
87 |
|
public abstract boolean lastPageFirst(); |
88 |
|
|
89 |
|
/** |
90 |
|
* Informs the print job that printing is complete or should be aborted. |
91 |
|
*/ |
92 |
|
public abstract void end(); |
93 |
|
|
94 |
|
/** |
95 |
|
* This method explicitly ends the print job in the event the job |
96 |
|
* becomes un-referenced without the application having done so. |
97 |
|
*/ |
98 |
|
public void finalize() |
99 |
|
{ |
100 |
|
end(); |
101 |
|
} |
102 |
} // class PrintJob |
} // class PrintJob |
|
|
|