KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > SheetCollate


1 /*
2  * @(#)SheetCollate.java 1.7 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import javax.print.attribute.Attribute JavaDoc;
10 import javax.print.attribute.EnumSyntax JavaDoc;
11 import javax.print.attribute.DocAttribute JavaDoc;
12 import javax.print.attribute.PrintRequestAttribute JavaDoc;
13 import javax.print.attribute.PrintJobAttribute JavaDoc;
14
15 /**
16  * Class SheetCollate is a printing attribute class, an enumeration, that
17  * specifies whether or not the media sheets of each copy of each printed
18  * document in a job are to be in sequence, when multiple copies of the document
19  * are specified by the {@link Copies Copies} attribute. When SheetCollate is
20  * COLLATED, each copy of each document is printed with the print-stream sheets
21  * in sequence. When SheetCollate is UNCOLLATED, each print-stream sheet is
22  * printed a number of times equal to the value of the {@link Copies Copies}
23  * attribute in succession. For example, suppose a document produces two media
24  * sheets as output, {@link Copies Copies} is 6, and SheetCollate is UNCOLLATED;
25  * in this case six copies of the first media sheet are printed followed by
26  * six copies of the second media sheet.
27  * <P>
28  * Whether the effect of sheet collation is achieved by placing copies of a
29  * document in multiple output bins or in the same output bin with
30  * implementation defined document separation is implementation dependent.
31  * Also whether it is achieved by making multiple passes over the job or by
32  * using an output sorter is implementation dependent.
33  * <P>
34  * If a printer does not support the SheetCollate attribute (meaning the client
35  * cannot specify any particular sheet collation), the printer must behave as
36  * though SheetCollate were always set to COLLATED.
37  * <P>
38  * The SheetCollate attribute interacts with the {@link MultipleDocumentHandling
39  * MultipleDocumentHandling} attribute. The {@link MultipleDocumentHandling
40  * MultipleDocumentHandling} attribute describes the collation of entire
41  * documents, and the SheetCollate attribute describes the semantics of
42  * collating individual pages within a document.
43  * <P>
44  * The effect of a SheetCollate attribute on a multidoc print job (a job with
45  * multiple documents) depends on whether all the docs have the same sheet
46  * collation specified or whether different docs have different sheet
47  * collations specified, and on the (perhaps defaulted) value of the {@link
48  * MultipleDocumentHandling MultipleDocumentHandling} attribute.
49  * <UL>
50  * <LI>
51  * If all the docs have the same sheet collation specified, then the following
52  * combinations of SheetCollate and {@link MultipleDocumentHandling
53  * MultipleDocumentHandling} are permitted, and the printer reports an error
54  * when the job is submitted if any other combination is specified:
55  * <UL>
56  * <LI>
57  * SheetCollate = COLLATED, {@link MultipleDocumentHandling
58  * MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
59  * combined into one output document. Multiple copies of the output document
60  * will be produced with pages in collated order, i.e. pages 1, 2, 3, . . .,
61  * 1, 2, 3, . . .
62  * <P>
63  * <LI>
64  * SheetCollate = COLLATED, {@link MultipleDocumentHandling
65  * MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input docs
66  * will be combined into one output document, and the first impression of each
67  * input doc will always start on a new media sheet. Multiple copies of the
68  * output document will be produced with pages in collated order, i.e. pages
69  * 1, 2, 3, . . ., 1, 2, 3, . . .
70  * <P>
71  * <LI>
72  * SheetCollate = COLLATED, {@link MultipleDocumentHandling
73  * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
74  * input doc will remain a separate output document. Multiple copies of each
75  * output document (call them A, B, . . .) will be produced with each document's
76  * pages in collated order, but the documents themselves in uncollated order,
77  * i.e. pages A1, A2, A3, . . ., A1, A2, A3, . . ., B1, B2, B3, . . ., B1, B2,
78  * B3, . . .
79  * <P>
80  * <LI>
81  * SheetCollate = COLLATED, {@link MultipleDocumentHandling
82  * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input
83  * doc will remain a separate output document. Multiple copies of each output
84  * document (call them A, B, . . .) will be produced with each document's pages
85  * in collated order, with the documents themselves also in collated order, i.e.
86  * pages A1, A2, A3, . . ., B1, B2, B3, . . ., A1, A2, A3, . . ., B1, B2, B3,
87  * . . .
88  * <P>
89  * <LI>
90  * SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
91  * MultipleDocumentHandling} = SINGLE_DOCUMENT -- All the input docs will be
92  * combined into one output document. Multiple copies of the output document
93  * will be produced with pages in uncollated order, i.e. pages 1, 1, . . .,
94  * 2, 2, . . ., 3, 3, . . .
95  * <P>
96  * <LI>
97  * SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
98  * MultipleDocumentHandling} = SINGLE_DOCUMENT_NEW_SHEET -- All the input docs
99  * will be combined into one output document, and the first impression of each
100  * input doc will always start on a new media sheet. Multiple copies of the
101  * output document will be produced with pages in uncollated order, i.e. pages
102  * 1, 1, . . ., 2, 2, . . ., 3, 3, . . .
103  * <P>
104  * <LI>
105  * SheetCollate = UNCOLLATED, {@link MultipleDocumentHandling
106  * MultipleDocumentHandling} = SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each
107  * input doc will remain a separate output document. Multiple copies of each
108  * output document (call them A, B, . . .) will be produced with each document's
109  * pages in uncollated order, with the documents themselves also in uncollated
110  * order, i.e. pages A1, A1, . . ., A2, A2, . . ., A3, A3, . . ., B1, B1, . . .,
111  * B2, B2, . . ., B3, B3, . . .
112  * </UL>
113  * <P>
114  * <LI>
115  * If different docs have different sheet collations specified, then only one
116  * value of {@link MultipleDocumentHandling MultipleDocumentHandling} is
117  * permitted, and the printer reports an error when the job is submitted if any
118  * other value is specified:
119  * <UL>
120  * <LI>
121  * {@link MultipleDocumentHandling MultipleDocumentHandling} =
122  * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will remain a separate
123  * output document. Multiple copies of each output document (call them A, B,
124  * . . .) will be produced with each document's pages in collated or uncollated
125  * order as the corresponding input doc's SheetCollate attribute specifies, and
126  * with the documents themselves in uncollated order. If document A had
127  * SheetCollate = UNCOLLATED and document B had SheetCollate = COLLATED, the
128  * following pages would be produced: A1, A1, . . ., A2, A2, . . ., A3, A3,
129  * . . ., B1, B2, B3, . . ., B1, B2, B3, . . .
130  * </UL>
131  * </UL>
132  * <P>
133  * <B>IPP Compatibility:</B> SheetCollate is not an IPP attribute at present.
134  * <P>
135  *
136  * @see MultipleDocumentHandling
137  *
138  * @author Alan Kaminsky
139  */

140 public final class SheetCollate extends EnumSyntax JavaDoc
141     implements DocAttribute JavaDoc, PrintRequestAttribute JavaDoc, PrintJobAttribute JavaDoc {
142
143     private static final long serialVersionUID = 7080587914259873003L;
144
145     /**
146      * Sheets within a document appear in uncollated order when multiple
147      * copies are printed.
148      */

149     public static final SheetCollate JavaDoc UNCOLLATED = new SheetCollate JavaDoc(0);
150
151     /**
152      * Sheets within a document appear in collated order when multiple copies
153      * are printed.
154      */

155     public static final SheetCollate JavaDoc COLLATED = new SheetCollate JavaDoc(1);
156
157     /**
158      * Construct a new sheet collate enumeration value with the given integer
159      * value.
160      *
161      * @param value Integer value.
162      */

163     protected SheetCollate(int value) {
164     super (value);
165     }
166
167     private static final String JavaDoc[] myStringTable = {
168     "uncollated",
169     "collated"
170     };
171
172     private static final SheetCollate JavaDoc[] myEnumValueTable = {
173     UNCOLLATED,
174     COLLATED
175     };
176
177     /**
178      * Returns the string table for class SheetCollate.
179      */

180     protected String JavaDoc[] getStringTable() {
181     return myStringTable;
182     }
183
184     /**
185      * Returns the enumeration value table for class SheetCollate.
186      */

187     protected EnumSyntax JavaDoc[] getEnumValueTable() {
188     return myEnumValueTable;
189     }
190
191     /**
192      * Get the printing attribute class which is to be used as the "category"
193      * for this printing attribute value.
194      * <P>
195      * For class SheetCollate, the category is class SheetCollate itself.
196      *
197      * @return Printing attribute class (category), an instance of class
198      * {@link java.lang.Class java.lang.Class}.
199      */

200     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
201     return SheetCollate JavaDoc.class;
202     }
203
204     /**
205      * Get the name of the category of which this attribute value is an
206      * instance.
207      * <P>
208      * For class SheetCollate, the category name is <CODE>"sheet-collate"</CODE>.
209      *
210      * @return Attribute category name.
211      */

212     public final String JavaDoc getName() {
213     return "sheet-collate";
214     }
215
216 }
217
Popular Tags