diff -r fd16c54261b3 -r 90ce3da70b43 jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/jdk/src/share/classes/javax/print/attribute/standard/SheetCollate.java Sat Dec 01 00:00:00 2007 +0000 @@ -0,0 +1,234 @@ +/* + * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package javax.print.attribute.standard; + +import javax.print.attribute.Attribute; +import javax.print.attribute.EnumSyntax; +import javax.print.attribute.DocAttribute; +import javax.print.attribute.PrintRequestAttribute; +import javax.print.attribute.PrintJobAttribute; + +/** + * Class SheetCollate is a printing attribute class, an enumeration, that + * specifies whether or not the media sheets of each copy of each printed + * document in a job are to be in sequence, when multiple copies of the document + * are specified by the {@link Copies Copies} attribute. When SheetCollate is + * COLLATED, each copy of each document is printed with the print-stream sheets + * in sequence. When SheetCollate is UNCOLLATED, each print-stream sheet is + * printed a number of times equal to the value of the {@link Copies Copies} + * attribute in succession. For example, suppose a document produces two media + * sheets as output, {@link Copies Copies} is 6, and SheetCollate is UNCOLLATED; + * in this case six copies of the first media sheet are printed followed by + * six copies of the second media sheet. + *

+ * Whether the effect of sheet collation is achieved by placing copies of a + * document in multiple output bins or in the same output bin with + * implementation defined document separation is implementation dependent. + * Also whether it is achieved by making multiple passes over the job or by + * using an output sorter is implementation dependent. + *

+ * If a printer does not support the SheetCollate attribute (meaning the client + * cannot specify any particular sheet collation), the printer must behave as + * though SheetCollate were always set to COLLATED. + *

+ * The SheetCollate attribute interacts with the {@link MultipleDocumentHandling + * MultipleDocumentHandling} attribute. The {@link MultipleDocumentHandling + * MultipleDocumentHandling} attribute describes the collation of entire + * documents, and the SheetCollate attribute describes the semantics of + * collating individual pages within a document. + *

+ * The effect of a SheetCollate attribute on a multidoc print job (a job with + * multiple documents) depends on whether all the docs have the same sheet + * collation specified or whether different docs have different sheet + * collations specified, and on the (perhaps defaulted) value of the {@link + * MultipleDocumentHandling MultipleDocumentHandling} attribute. + *

+ *

+ * IPP Compatibility: SheetCollate is not an IPP attribute at present. + *

+ * + * @see MultipleDocumentHandling + * + * @author Alan Kaminsky + */ +public final class SheetCollate extends EnumSyntax + implements DocAttribute, PrintRequestAttribute, PrintJobAttribute { + + private static final long serialVersionUID = 7080587914259873003L; + + /** + * Sheets within a document appear in uncollated order when multiple + * copies are printed. + */ + public static final SheetCollate UNCOLLATED = new SheetCollate(0); + + /** + * Sheets within a document appear in collated order when multiple copies + * are printed. + */ + public static final SheetCollate COLLATED = new SheetCollate(1); + + /** + * Construct a new sheet collate enumeration value with the given integer + * value. + * + * @param value Integer value. + */ + protected SheetCollate(int value) { + super (value); + } + + private static final String[] myStringTable = { + "uncollated", + "collated" + }; + + private static final SheetCollate[] myEnumValueTable = { + UNCOLLATED, + COLLATED + }; + + /** + * Returns the string table for class SheetCollate. + */ + protected String[] getStringTable() { + return myStringTable; + } + + /** + * Returns the enumeration value table for class SheetCollate. + */ + protected EnumSyntax[] getEnumValueTable() { + return myEnumValueTable; + } + + /** + * Get the printing attribute class which is to be used as the "category" + * for this printing attribute value. + *

+ * For class SheetCollate, the category is class SheetCollate itself. + * + * @return Printing attribute class (category), an instance of class + * {@link java.lang.Class java.lang.Class}. + */ + public final Class getCategory() { + return SheetCollate.class; + } + + /** + * Get the name of the category of which this attribute value is an + * instance. + *

+ * For class SheetCollate, the category name is "sheet-collate". + * + * @return Attribute category name. + */ + public final String getName() { + return "sheet-collate"; + } + +}