0N/A/*
2362N/A * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/Apackage javax.print.attribute.standard;
0N/A
0N/Aimport javax.print.attribute.Attribute;
0N/Aimport javax.print.attribute.EnumSyntax;
0N/Aimport javax.print.attribute.DocAttribute;
0N/Aimport javax.print.attribute.PrintRequestAttribute;
0N/Aimport javax.print.attribute.PrintJobAttribute;
0N/A
0N/A/**
0N/A * Class Finishings is a printing attribute class, an enumeration, that
0N/A * identifies whether the printer applies a finishing operation of some kind
0N/A * of binding to each copy of each printed document in the job. For multidoc
0N/A * print jobs (jobs with multiple documents), the
0N/A * {@link MultipleDocumentHandling
0N/A * MultipleDocumentHandling} attribute determines what constitutes a "copy"
0N/A * for purposes of finishing.
0N/A * <P>
0N/A * Standard Finishings values are:
0N/A * <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% SUMMARY="layout">
0N/A * <TR>
0N/A * <TD WIDTH=10%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #NONE <CODE>NONE</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE <CODE>STAPLE</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=36%>
0N/A * {@link #EDGE_STITCH <CODE>EDGE_STITCH</CODE>}
0N/A * </TD>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD>
0N/A * &nbsp;
0N/A * </TD>
0N/A * <TD>
0N/A * {@link #BIND <CODE>BIND</CODE>}
0N/A * </TD>
0N/A * <TD>
0N/A * {@link #SADDLE_STITCH <CODE>SADDLE_STITCH</CODE>}
0N/A * </TD>
0N/A * <TD>
0N/A * {@link #COVER <CODE>COVER</CODE>}
0N/A * </TD>
0N/A * <TD>
0N/A * &nbsp;
0N/A * </TD>
0N/A * </TR>
0N/A * </TABLE>
0N/A * <P>
0N/A * The following Finishings values are more specific; they indicate a
0N/A * corner or an edge as if the document were a portrait document:
0N/A * <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% SUMMARY="layout">
0N/A * <TR>
0N/A * <TD WIDTH=10%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_TOP_LEFT <CODE>STAPLE_TOP_LEFT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #EDGE_STITCH_LEFT <CODE>EDGE_STITCH_LEFT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_DUAL_LEFT <CODE>STAPLE_DUAL_LEFT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=9%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD WIDTH=10%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_BOTTOM_LEFT <CODE>STAPLE_BOTTOM_LEFT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #EDGE_STITCH_TOP <CODE>EDGE_STITCH_TOP</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_DUAL_TOP <CODE>STAPLE_DUAL_TOP</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=9%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD WIDTH=10%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_TOP_RIGHT <CODE>STAPLE_TOP_RIGHT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #EDGE_STITCH_RIGHT <CODE>EDGE_STITCH_RIGHT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_DUAL_RIGHT <CODE>STAPLE_DUAL_RIGHT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=9%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * </TR>
0N/A * <TR>
0N/A * <TD WIDTH=10%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_BOTTOM_RIGHT <CODE>STAPLE_BOTTOM_RIGHT</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #EDGE_STITCH_BOTTOM <CODE>EDGE_STITCH_BOTTOM</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=27%>
0N/A * {@link #STAPLE_DUAL_BOTTOM <CODE>STAPLE_DUAL_BOTTOM</CODE>}
0N/A * </TD>
0N/A * <TD WIDTH=9%>
0N/A * &nbsp;
0N/A * </TD>
0N/A * </TR>
0N/A * </TABLE>
0N/A * <P>
0N/A * The <CODE>STAPLE_<I>XXX</I></CODE> values are specified with respect to the
0N/A * document as if the document were a portrait document. If the document is
0N/A * actually a landscape or a reverse-landscape document, the client supplies the
0N/A * appropriate transformed value. For example, to position a staple in the upper
0N/A * left hand corner of a landscape document when held for reading, the client
0N/A * supplies the <CODE>STAPLE_BOTTOM_LEFT</CODE> value (since landscape is
0N/A * defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the
0N/A * other hand, to position a staple in the upper left hand corner of a
0N/A * reverse-landscape document when held for reading, the client supplies the
0N/A * <CODE>STAPLE_TOP_RIGHT</CODE> value (since reverse-landscape is defined as a
0N/A * -90 degree rotation from portrait, i.e., clockwise).
0N/A * <P>
0N/A * The angle (vertical, horizontal, angled) of each staple with respect to the
0N/A * document depends on the implementation which may in turn depend on the value
0N/A * of the attribute.
0N/A * <P>
0N/A * The effect of a Finishings attribute on a multidoc print job (a job
0N/A * with multiple documents) depends on whether all the docs have the same
0N/A * binding specified or whether different docs have different bindings
0N/A * specified, and on the (perhaps defaulted) value of the {@link
0N/A * MultipleDocumentHandling MultipleDocumentHandling} attribute.
0N/A * <UL>
0N/A * <LI>
0N/A * If all the docs have the same binding specified, then any value of {@link
0N/A * MultipleDocumentHandling MultipleDocumentHandling} makes sense, and the
0N/A * printer's processing depends on the {@link MultipleDocumentHandling
0N/A * MultipleDocumentHandling} value:
0N/A * <UL>
0N/A * <LI>
0N/A * SINGLE_DOCUMENT -- All the input docs will be bound together as one output
0N/A * document with the specified binding.
0N/A * <P>
0N/A * <LI>
0N/A * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be bound together as one
0N/A * output document with the specified binding, and the first impression of each
0N/A * input doc will always start on a new media sheet.
0N/A * <P>
0N/A * <LI>
0N/A * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
0N/A * separately with the specified binding.
0N/A * <P>
0N/A * <LI>
0N/A * SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
0N/A * with the specified binding.
0N/A * </UL>
0N/A * <P>
0N/A * <LI>
0N/A * If different docs have different bindings specified, then only two values of
0N/A * {@link MultipleDocumentHandling MultipleDocumentHandling} make sense, and the
0N/A * printer reports an error when the job is submitted if any other value is
0N/A * specified:
0N/A * <UL>
0N/A * <LI>
0N/A * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
0N/A * separately with its own specified binding.
0N/A * <P>
0N/A * <LI>
0N/A * SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
0N/A * with its own specified binding.
0N/A * </UL>
0N/A * </UL>
0N/A * <P>
0N/A * <B>IPP Compatibility:</B> Class Finishings encapsulates some of the
0N/A * IPP enum values that can be included in an IPP "finishings" attribute, which
0N/A * is a set of enums. The category name returned by
0N/A * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
0N/A * integer value is the IPP enum value. The <code>toString()</code> method
0N/A * returns the IPP string representation of the attribute value.
0N/A * In IPP Finishings is a multi-value attribute, this API currently allows
0N/A * only one binding to be specified.
0N/A *
0N/A * @author Alan Kaminsky
0N/A */
0N/Apublic class Finishings extends EnumSyntax
0N/A implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
0N/A
0N/A private static final long serialVersionUID = -627840419548391754L;
0N/A
0N/A /**
0N/A * Perform no binding.
0N/A */
0N/A public static final Finishings NONE = new Finishings(3);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples. The exact number and
0N/A * placement of the staples is site-defined.
0N/A */
0N/A public static final Finishings STAPLE = new Finishings(4);
0N/A
0N/A /**
0N/A * This value is specified when it is desired to select a non-printed (or
0N/A * pre-printed) cover for the document. This does not supplant the
0N/A * specification of a printed cover (on cover stock medium) by the
0N/A * document itself.
0N/A */
0N/A public static final Finishings COVER = new Finishings(6);
0N/A
0N/A /**
0N/A * This value indicates that a binding is to be applied to the document;
0N/A * the type and placement of the binding is site-defined.
0N/A */
0N/A public static final Finishings BIND = new Finishings(7);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples (wire stitches) along the
0N/A * middle fold. The exact number and placement of the staples and the
0N/A * middle fold is implementation- and/or site-defined.
0N/A */
0N/A public static final Finishings SADDLE_STITCH =
0N/A new Finishings(8);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples (wire stitches) along one
0N/A * edge. The exact number and placement of the staples is implementation-
0N/A * and/or site- defined.
0N/A */
0N/A public static final Finishings EDGE_STITCH =
0N/A new Finishings(9);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples in the top left corner.
0N/A */
0N/A public static final Finishings STAPLE_TOP_LEFT =
0N/A new Finishings(20);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples in the bottom left
0N/A * corner.
0N/A */
0N/A public static final Finishings STAPLE_BOTTOM_LEFT =
0N/A new Finishings(21);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples in the top right corner.
0N/A */
0N/A public static final Finishings STAPLE_TOP_RIGHT =
0N/A new Finishings(22);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples in the bottom right
0N/A * corner.
0N/A */
0N/A public static final Finishings STAPLE_BOTTOM_RIGHT =
0N/A new Finishings(23);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples (wire stitches) along the
0N/A * left edge. The exact number and placement of the staples is
0N/A * implementation- and/or site-defined.
0N/A */
0N/A public static final Finishings EDGE_STITCH_LEFT =
0N/A new Finishings(24);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples (wire stitches) along the
0N/A * top edge. The exact number and placement of the staples is
0N/A * implementation- and/or site-defined.
0N/A */
0N/A public static final Finishings EDGE_STITCH_TOP =
0N/A new Finishings(25);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples (wire stitches) along the
0N/A * right edge. The exact number and placement of the staples is
0N/A * implementation- and/or site-defined.
0N/A */
0N/A public static final Finishings EDGE_STITCH_RIGHT =
0N/A new Finishings(26);
0N/A
0N/A /**
0N/A * Bind the document(s) with one or more staples (wire stitches) along the
0N/A * bottom edge. The exact number and placement of the staples is
0N/A * implementation- and/or site-defined.
0N/A */
0N/A public static final Finishings EDGE_STITCH_BOTTOM =
0N/A new Finishings(27);
0N/A
0N/A /**
0N/A * Bind the document(s) with two staples (wire stitches) along the left
0N/A * edge assuming a portrait document (see above).
0N/A */
0N/A public static final Finishings STAPLE_DUAL_LEFT =
0N/A new Finishings(28);
0N/A
0N/A /**
0N/A * Bind the document(s) with two staples (wire stitches) along the top
0N/A * edge assuming a portrait document (see above).
0N/A */
0N/A public static final Finishings STAPLE_DUAL_TOP =
0N/A new Finishings(29);
0N/A
0N/A /**
0N/A * Bind the document(s) with two staples (wire stitches) along the right
0N/A * edge assuming a portrait document (see above).
0N/A */
0N/A public static final Finishings STAPLE_DUAL_RIGHT =
0N/A new Finishings(30);
0N/A
0N/A /**
0N/A * Bind the document(s) with two staples (wire stitches) along the bottom
0N/A * edge assuming a portrait document (see above).
0N/A */
0N/A public static final Finishings STAPLE_DUAL_BOTTOM =
0N/A new Finishings(31);
0N/A
0N/A /**
0N/A * Construct a new finishings binding enumeration value with the given
0N/A * integer value.
0N/A *
0N/A * @param value Integer value.
0N/A */
0N/A protected Finishings(int value) {
0N/A super(value);
0N/A }
0N/A
0N/A private static final String[] myStringTable =
0N/A {"none",
0N/A "staple",
0N/A null,
0N/A "cover",
0N/A "bind",
0N/A "saddle-stitch",
0N/A "edge-stitch",
0N/A null, // The next ten enum values are reserved.
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A "staple-top-left",
0N/A "staple-bottom-left",
0N/A "staple-top-right",
0N/A "staple-bottom-right",
0N/A "edge-stitch-left",
0N/A "edge-stitch-top",
0N/A "edge-stitch-right",
0N/A "edge-stitch-bottom",
0N/A "staple-dual-left",
0N/A "staple-dual-top",
0N/A "staple-dual-right",
0N/A "staple-dual-bottom"
0N/A };
0N/A
0N/A private static final Finishings[] myEnumValueTable =
0N/A {NONE,
0N/A STAPLE,
0N/A null,
0N/A COVER,
0N/A BIND,
0N/A SADDLE_STITCH,
0N/A EDGE_STITCH,
0N/A null, // The next ten enum values are reserved.
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A null,
0N/A STAPLE_TOP_LEFT,
0N/A STAPLE_BOTTOM_LEFT,
0N/A STAPLE_TOP_RIGHT,
0N/A STAPLE_BOTTOM_RIGHT,
0N/A EDGE_STITCH_LEFT,
0N/A EDGE_STITCH_TOP,
0N/A EDGE_STITCH_RIGHT,
0N/A EDGE_STITCH_BOTTOM,
0N/A STAPLE_DUAL_LEFT,
0N/A STAPLE_DUAL_TOP,
0N/A STAPLE_DUAL_RIGHT,
0N/A STAPLE_DUAL_BOTTOM
0N/A };
0N/A
0N/A /**
0N/A * Returns the string table for class Finishings.
0N/A */
0N/A protected String[] getStringTable() {
0N/A return (String[])myStringTable.clone();
0N/A }
0N/A
0N/A /**
0N/A * Returns the enumeration value table for class Finishings.
0N/A */
0N/A protected EnumSyntax[] getEnumValueTable() {
0N/A return (EnumSyntax[])myEnumValueTable.clone();
0N/A }
0N/A
0N/A /**
0N/A * Returns the lowest integer value used by class Finishings.
0N/A */
0N/A protected int getOffset() {
0N/A return 3;
0N/A }
0N/A
0N/A /**
0N/A * Get the printing attribute class which is to be used as the "category"
0N/A * for this printing attribute value.
0N/A * <P>
0N/A * For class Finishings and any vendor-defined subclasses, the
0N/A * category is class Finishings itself.
0N/A *
0N/A * @return Printing attribute class (category), an instance of class
0N/A * {@link java.lang.Class java.lang.Class}.
0N/A */
0N/A public final Class<? extends Attribute> getCategory() {
0N/A return Finishings.class;
0N/A }
0N/A
0N/A /**
0N/A * Get the name of the category of which this attribute value is an
0N/A * instance.
0N/A * <P>
0N/A * For class Finishings and any vendor-defined subclasses, the
0N/A * category name is <CODE>"finishings"</CODE>.
0N/A *
0N/A * @return Attribute category name.
0N/A */
0N/A public final String getName() {
0N/A return "finishings";
0N/A }
0N/A
0N/A}