/* * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ 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 Sides is a printing attribute class, an enumeration, that specifies * how print-stream pages are to be imposed upon the sides of an instance of a * selected medium, i.e., an impression. *

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

*

* IPP Compatibility: The category name returned by * getName() is the IPP attribute name. The enumeration's * integer value is the IPP enum value. The toString() method * returns the IPP string representation of the attribute value. *

* * @author Alan Kaminsky */ public final class Sides extends EnumSyntax implements DocAttribute, PrintRequestAttribute, PrintJobAttribute { private static final long serialVersionUID = -6890309414893262822L; /** * Imposes each consecutive print-stream page upon the same side of * consecutive media sheets. */ public static final Sides ONE_SIDED = new Sides(0); /** * Imposes each consecutive pair of print-stream pages upon front and back * sides of consecutive media sheets, such that the orientation of each * pair of print-stream pages on the medium would be correct for the * reader as if for binding on the long edge. This imposition is also * known as "duplex" (see {@link #DUPLEX DUPLEX}). */ public static final Sides TWO_SIDED_LONG_EDGE = new Sides(1); /** * Imposes each consecutive pair of print-stream pages upon front and back * sides of consecutive media sheets, such that the orientation of each * pair of print-stream pages on the medium would be correct for the * reader as if for binding on the short edge. This imposition is also * known as "tumble" (see {@link #TUMBLE TUMBLE}). */ public static final Sides TWO_SIDED_SHORT_EDGE = new Sides(2); /** * An alias for "two sided long edge" (see {@link #TWO_SIDED_LONG_EDGE * TWO_SIDED_LONG_EDGE}). */ public static final Sides DUPLEX = TWO_SIDED_LONG_EDGE; /** * An alias for "two sided short edge" (see {@link #TWO_SIDED_SHORT_EDGE * TWO_SIDED_SHORT_EDGE}). */ public static final Sides TUMBLE = TWO_SIDED_SHORT_EDGE; /** * Construct a new sides enumeration value with the given integer value. * * @param value Integer value. */ protected Sides(int value) { super (value); } private static final String[] myStringTable = { "one-sided", "two-sided-long-edge", "two-sided-short-edge" }; private static final Sides[] myEnumValueTable = { ONE_SIDED, TWO_SIDED_LONG_EDGE, TWO_SIDED_SHORT_EDGE }; /** * Returns the string table for class Sides. */ protected String[] getStringTable() { return myStringTable; } /** * Returns the enumeration value table for class Sides. */ 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 Sides, the category is class Sides itself. * * @return Printing attribute class (category), an instance of class * {@link java.lang.Class java.lang.Class}. */ public final Class getCategory() { return Sides.class; } /** * Get the name of the category of which this attribute value is an * instance. *

* For class Sides, the category name is "sides". * * @return Attribute category name. */ public final String getName() { return "sides"; } }