< prev index next >

src/java.desktop/share/classes/javax/print/attribute/standard/Finishings.java

Print this page




   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */

  25 package javax.print.attribute.standard;
  26 
  27 import javax.print.attribute.Attribute;
  28 import javax.print.attribute.EnumSyntax;
  29 import javax.print.attribute.DocAttribute;
  30 import javax.print.attribute.PrintRequestAttribute;
  31 import javax.print.attribute.PrintJobAttribute;

  32 
  33 /**
  34  * Class Finishings is a printing attribute class, an enumeration, that
  35  * identifies whether the printer applies a finishing operation of some kind
  36  * of binding to each copy of each printed document in the job. For multidoc
  37  * print jobs (jobs with multiple documents), the
  38  * {@link MultipleDocumentHandling
  39  * MultipleDocumentHandling} attribute determines what constitutes a "copy"
  40  * for purposes of finishing.
  41  * <P>
  42  * Standard Finishings values are:
  43  * <table class="borderless" style="width:100%;margin: 0px auto">
  44  * <caption>Standard Finishings values</caption>
  45  * <TR>
  46  * <TD STYLE="WIDTH:10%">
  47  * &nbsp;
  48  * </TD>
  49  * <TD STYLE="WIDTH:27%">
  50  * {@link #NONE NONE}
  51  * </TD>
  52  * <TD STYLE="WIDTH:27%">
  53  * {@link #STAPLE STAPLE}
  54  * </TD>
  55  * <TD STYLE="WIDTH:36%">
  56  * {@link #EDGE_STITCH EDGE_STITCH}
  57  * </TD>
  58  * </TR>
  59  * <TR>
  60  * <TD>
  61  * &nbsp;
  62  * </TD>
  63  * <TD>
  64  * {@link #BIND BIND}
  65  * </TD>
  66  * <TD>
  67  * {@link #SADDLE_STITCH SADDLE_STITCH}
  68  * </TD>
  69  * <TD>
  70  * {@link #COVER COVER}
  71  * </TD>
  72  * <TD>
  73  * &nbsp;
  74  * </TD>
  75  * </TR>
  76  * </TABLE>
  77  * <P>
  78  * The following Finishings values are more specific; they indicate a
  79  * corner or an edge as if the document were a portrait document:
  80  * <table class="borderless" style="width:100%;margin: 0px auto">
  81  * <caption>Specific Finishings values</caption>
  82  * <TR>
  83  * <TD STYLE="WIDTH:10%">
  84  * &nbsp;
  85  * </TD>
  86  * <TD STYLE="WIDTH:27%">
  87  * {@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
  88  * </TD>
  89  * <TD STYLE="WIDTH:27%">
  90  * {@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
  91  * </TD>
  92  * <TD STYLE="WIDTH:27%">
  93  * {@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
  94  * </TD>
  95  * <TD STYLE="WIDTH:9%">
  96  * &nbsp;
  97  * </TD>
  98  * </TR>
  99  * <TR>
 100  * <TD STYLE="WIDTH:10%">
 101  * &nbsp;
 102  * </TD>
 103  * <TD STYLE="WIDTH:27%">
 104  * {@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
 105  * </TD>
 106  * <TD STYLE="WIDTH:27%">
 107  * {@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
 108  * </TD>
 109  * <TD STYLE="WIDTH:27%">
 110  * {@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
 111  * </TD>
 112  * <TD STYLE="WIDTH:9%">
 113  * &nbsp;
 114  * </TD>
 115  * </TR>
 116  * <TR>
 117  * <TD STYLE="WIDTH:10%">
 118  * &nbsp;
 119  * </TD>
 120  * <TD STYLE="WIDTH:27%">
 121  * {@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
 122  * </TD>
 123  * <TD STYLE="WIDTH:27%">
 124  * {@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
 125  * </TD>
 126  * <TD STYLE="WIDTH:27%">
 127  * {@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
 128  * </TD>
 129  * <TD STYLE="WIDTH:9%">
 130  * &nbsp;
 131  * </TD>
 132  * </TR>
 133  * <TR>
 134  * <TD STYLE="WIDTH:10%">
 135  * &nbsp;
 136  * </TD>
 137  * <TD STYLE="WIDTH:27%">
 138  * {@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
 139  * </TD>
 140  * <TD STYLE="WIDTH:27%">
 141  * {@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
 142  * </TD>
 143  * <TD STYLE="WIDTH:27%">
 144  * {@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
 145  * </TD>
 146  * <TD STYLE="WIDTH:9%">
 147  * &nbsp;
 148  * </TD>
 149  * </TR>
 150  * </TABLE>
 151  * <P>
 152  * The STAPLE_<I>XXX</I> values are specified with respect to the
 153  * document as if the document were a portrait document. If the document is
 154  * actually a landscape or a reverse-landscape document, the client supplies the
 155  * appropriate transformed value. For example, to position a staple in the upper
 156  * left hand corner of a landscape document when held for reading, the client
 157  * supplies the STAPLE_BOTTOM_LEFT value (since landscape is
 158  * defined as a +90 degree rotation from portrait, i.e., anti-clockwise). On the
 159  * other hand, to position a staple in the upper left hand corner of a
 160  * reverse-landscape document when held for reading, the client supplies the
 161  * STAPLE_TOP_RIGHT value (since reverse-landscape is defined as a
 162  * -90 degree rotation from portrait, i.e., clockwise).
 163  * <P>
 164  * The angle (vertical, horizontal, angled) of each staple with respect to the
 165  * document depends on the implementation which may in turn depend on the value
 166  * of the attribute.
 167  * <P>
 168  * The effect of a Finishings attribute on a multidoc print job (a job
 169  * with multiple documents) depends on whether all the docs have the same
 170  * binding specified or whether different docs have different bindings
 171  * specified, and on the (perhaps defaulted) value of the {@link
 172  * MultipleDocumentHandling MultipleDocumentHandling} attribute.
 173  * <UL>
 174  * <LI>
 175  * If all the docs have the same binding specified, then any value of {@link
 176  * MultipleDocumentHandling MultipleDocumentHandling} makes sense, and the
 177  * printer's processing depends on the {@link MultipleDocumentHandling
 178  * MultipleDocumentHandling} value:
 179  * <UL>
 180  * <LI>
 181  * SINGLE_DOCUMENT -- All the input docs will be bound together as one output
 182  * document with the specified binding.
 183  *
 184  * <LI>
 185  * SINGLE_DOCUMENT_NEW_SHEET -- All the input docs will be bound together as one
 186  * output document with the specified binding, and the first impression of each
 187  * input doc will always start on a new media sheet.
 188  *
 189  * <LI>
 190  * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
 191  * separately with the specified binding.
 192  *
 193  * <LI>
 194  * SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
 195  * with the specified binding.
 196  * </UL>
 197  *
 198  * <LI>
 199  * If different docs have different bindings specified, then only two values of
 200  * {@link MultipleDocumentHandling MultipleDocumentHandling} make sense, and the
 201  * printer reports an error when the job is submitted if any other value is
 202  * specified:
 203  * <UL>
 204  * <LI>
 205  * SEPARATE_DOCUMENTS_UNCOLLATED_COPIES -- Each input doc will be bound
 206  * separately with its own specified binding.
 207  *
 208  * <LI>
 209  * SEPARATE_DOCUMENTS_COLLATED_COPIES -- Each input doc will be bound separately
 210  * with its own specified binding.
 211  * </UL>
 212  * </UL>
 213  * <P>
 214  * <B>IPP Compatibility:</B> Class Finishings encapsulates some of the
 215  * IPP enum values that can be included in an IPP "finishings" attribute, which
 216  * is a set of enums. The category name returned by
 217  * {@code getName()} is the IPP attribute name.  The enumeration's
 218  * integer value is the IPP enum value.  The {@code toString()} method
 219  * returns the IPP string representation of the attribute value.
 220  * In IPP Finishings is a multi-value attribute, this API currently allows
 221  * only one binding to be specified.
 222  *
 223  * @author  Alan Kaminsky
 224  */
 225 public class Finishings extends EnumSyntax
 226     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
 227 



 228     private static final long serialVersionUID = -627840419548391754L;
 229 
 230     /**
 231      * Perform no binding.
 232      */
 233     public static final Finishings NONE = new Finishings(3);
 234 
 235     /**
 236      * Bind the document(s) with one or more staples. The exact number and
 237      * placement of the staples is site-defined.
 238      */
 239     public static final Finishings STAPLE = new Finishings(4);
 240 
 241     /**
 242      * This value is specified when it is desired to select a non-printed (or
 243      * pre-printed) cover for the document. This does not supplant the
 244      * specification of a printed cover (on cover stock medium) by the
 245      * document  itself.
 246      */
 247     public static final Finishings COVER = new Finishings(6);
 248 
 249     /**
 250      * This value indicates that a binding is to be applied to the document;
 251      * the type and placement of the binding is site-defined.
 252      */
 253     public static final Finishings BIND = new Finishings(7);
 254 
 255     /**
 256      * Bind the document(s) with one or more staples (wire stitches) along the
 257      * middle fold. The exact number and placement of the staples and the
 258      * middle fold is implementation- and/or site-defined.
 259      */
 260     public static final Finishings SADDLE_STITCH =
 261         new Finishings(8);
 262 
 263     /**
 264      * Bind the document(s) with one or more staples (wire stitches) along one
 265      * edge. The exact number and placement of the staples is implementation-
 266      * and/or site- defined.
 267      */
 268     public static final Finishings EDGE_STITCH =
 269         new Finishings(9);
 270 
 271     /**
 272      * Bind the document(s) with one or more staples in the top left corner.
 273      */
 274     public static final Finishings STAPLE_TOP_LEFT =
 275         new Finishings(20);
 276 
 277     /**
 278      * Bind the document(s) with one or more staples in the bottom left
 279      * corner.
 280      */
 281     public static final Finishings STAPLE_BOTTOM_LEFT =
 282         new Finishings(21);
 283 
 284     /**
 285      * Bind the document(s) with one or more staples in the top right corner.
 286      */
 287     public static final Finishings STAPLE_TOP_RIGHT =
 288         new Finishings(22);
 289 
 290     /**
 291      * Bind the document(s) with one or more staples in the bottom right
 292      * corner.
 293      */
 294     public static final Finishings STAPLE_BOTTOM_RIGHT =
 295         new Finishings(23);
 296 
 297     /**
 298      * Bind the document(s) with one or more staples (wire stitches) along the
 299      * left edge. The exact number and placement of the staples is
 300      * implementation- and/or site-defined.
 301      */
 302     public static final Finishings EDGE_STITCH_LEFT =
 303         new Finishings(24);
 304 
 305     /**
 306      * Bind the document(s) with one or more staples (wire stitches) along the
 307      * top edge. The exact number and placement of the staples is
 308      * implementation- and/or site-defined.
 309      */
 310     public static final Finishings EDGE_STITCH_TOP =
 311         new Finishings(25);
 312 
 313     /**
 314      * Bind the document(s) with one or more staples (wire stitches) along the
 315      * right edge. The exact number and placement of the staples is
 316      * implementation- and/or site-defined.
 317      */
 318     public static final Finishings EDGE_STITCH_RIGHT =
 319         new Finishings(26);
 320 
 321     /**
 322      * Bind the document(s) with one or more staples (wire stitches) along the
 323      * bottom edge. The exact number and placement of the staples is
 324      * implementation- and/or site-defined.
 325      */
 326     public static final Finishings EDGE_STITCH_BOTTOM =
 327         new Finishings(27);
 328 
 329     /**
 330      * Bind the document(s) with two staples (wire stitches) along the left
 331      * edge assuming a portrait document (see above).
 332      */
 333     public static final Finishings STAPLE_DUAL_LEFT =
 334         new Finishings(28);
 335 
 336     /**
 337      * Bind the document(s) with two staples (wire stitches) along the top
 338      * edge assuming a portrait document (see above).
 339      */
 340     public static final Finishings STAPLE_DUAL_TOP =
 341         new Finishings(29);
 342 
 343     /**
 344      * Bind the document(s) with two staples (wire stitches) along the right
 345      * edge assuming a portrait document (see above).
 346      */
 347     public static final Finishings STAPLE_DUAL_RIGHT =
 348         new Finishings(30);
 349 
 350     /**
 351      * Bind the document(s) with two staples (wire stitches) along the bottom
 352      * edge assuming a portrait document (see above).
 353      */
 354     public static final Finishings STAPLE_DUAL_BOTTOM =
 355         new Finishings(31);
 356 
 357     /**
 358      * Construct a new finishings binding enumeration value with the given
 359      * integer value.
 360      *
 361      * @param  value  Integer value.
 362      */
 363     protected Finishings(int value) {
 364         super(value);
 365     }
 366 



 367     private static final String[] myStringTable =
 368                 {"none",
 369                  "staple",
 370                  null,
 371                  "cover",
 372                  "bind",
 373                  "saddle-stitch",
 374                  "edge-stitch",
 375                  null, // The next ten enum values are reserved.
 376                  null,
 377                  null,
 378                  null,
 379                  null,
 380                  null,
 381                  null,
 382                  null,
 383                  null,
 384                  null,
 385                  "staple-top-left",
 386                  "staple-bottom-left",
 387                  "staple-top-right",
 388                  "staple-bottom-right",
 389                  "edge-stitch-left",
 390                  "edge-stitch-top",
 391                  "edge-stitch-right",
 392                  "edge-stitch-bottom",
 393                  "staple-dual-left",
 394                  "staple-dual-top",
 395                  "staple-dual-right",
 396                  "staple-dual-bottom"
 397                 };
 398 



 399     private static final Finishings[] myEnumValueTable =
 400                 {NONE,
 401                  STAPLE,
 402                  null,
 403                  COVER,
 404                  BIND,
 405                  SADDLE_STITCH,
 406                  EDGE_STITCH,
 407                  null, // The next ten enum values are reserved.
 408                  null,
 409                  null,
 410                  null,
 411                  null,
 412                  null,
 413                  null,
 414                  null,
 415                  null,
 416                  null,
 417                  STAPLE_TOP_LEFT,
 418                  STAPLE_BOTTOM_LEFT,
 419                  STAPLE_TOP_RIGHT,
 420                  STAPLE_BOTTOM_RIGHT,
 421                  EDGE_STITCH_LEFT,
 422                  EDGE_STITCH_TOP,
 423                  EDGE_STITCH_RIGHT,
 424                  EDGE_STITCH_BOTTOM,
 425                  STAPLE_DUAL_LEFT,
 426                  STAPLE_DUAL_TOP,
 427                  STAPLE_DUAL_RIGHT,
 428                  STAPLE_DUAL_BOTTOM
 429                 };
 430 
 431     /**
 432      * Returns the string table for class Finishings.
 433      */
 434     protected String[] getStringTable() {
 435         return myStringTable.clone();
 436     }
 437 
 438     /**
 439      * Returns the enumeration value table for class Finishings.
 440      */
 441     protected EnumSyntax[] getEnumValueTable() {
 442         return (EnumSyntax[])myEnumValueTable.clone();
 443     }
 444 
 445     /**
 446      * Returns the lowest integer value used by class Finishings.
 447      */
 448     protected int getOffset() {
 449         return 3;
 450     }
 451 
 452     /**
 453      * Get the printing attribute class which is to be used as the "category"
 454      * for this printing attribute value.
 455      * <P>
 456      * For class Finishings and any vendor-defined subclasses, the
 457      * category is class Finishings itself.
 458      *
 459      * @return  Printing attribute class (category), an instance of class
 460      *          {@link java.lang.Class java.lang.Class}.
 461      */
 462     public final Class<? extends Attribute> getCategory() {
 463         return Finishings.class;
 464     }
 465 
 466     /**
 467      * Get the name of the category of which this attribute value is an
 468      * instance.
 469      * <P>
 470      * For class Finishings and any vendor-defined subclasses, the
 471      * category name is {@code "finishings"}.
 472      *
 473      * @return  Attribute category name.
 474      */
 475     public final String getName() {
 476         return "finishings";
 477     }
 478 
 479 }


   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.print.attribute.standard;
  27 
  28 import javax.print.attribute.Attribute;

  29 import javax.print.attribute.DocAttribute;
  30 import javax.print.attribute.EnumSyntax;
  31 import javax.print.attribute.PrintJobAttribute;
  32 import javax.print.attribute.PrintRequestAttribute;
  33 
  34 /**
  35  * Class {@code Finishings} is a printing attribute class, an enumeration, that
  36  * identifies whether the printer applies a finishing operation of some kind of
  37  * binding to each copy of each printed document in the job. For multidoc print
  38  * jobs (jobs with multiple documents), the
  39  * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute
  40  * determines what constitutes a "copy" for purposes of finishing.
  41  * <p>

  42  * Standard Finishings values are:
  43  * <table class="borderless" style="width:100%;margin: 0px auto">
  44  * <caption>Standard Finishings values</caption>
  45  *   <tr>
  46  *     <td style="width:10%">&nbsp;
  47  *     <td style="width:27%">{@link #NONE NONE}
  48  *     <td style="width:27%">{@link #STAPLE STAPLE}
  49  *     <td style="width:36%">{@link #EDGE_STITCH EDGE_STITCH}
  50  *   <tr>
  51  *     <td>&nbsp;
  52  *     <td>{@link #BIND BIND}
  53  *     <td>{@link #SADDLE_STITCH SADDLE_STITCH}
  54  *     <td>{@link #COVER COVER}
  55  *     <td>&nbsp;
  56  * </table>
  57  * <p>
  58  * The following {@code Finishings} values are more specific; they indicate a




















  59  * corner or an edge as if the document were a portrait document:
  60  * <table class="borderless" style="width:100%;margin: 0px auto">
  61  * <caption>Specific Finishings values</caption>
  62  *   <tr>
  63  *     <td style="width:10%">&nbsp;
  64  *     <td style="width:27%">{@link #STAPLE_TOP_LEFT STAPLE_TOP_LEFT}
  65  *     <td style="width:27%">{@link #EDGE_STITCH_LEFT EDGE_STITCH_LEFT}
  66  *     <td style="width:27%">{@link #STAPLE_DUAL_LEFT STAPLE_DUAL_LEFT}
  67  *     <td style="width:9%">&nbsp;
  68  *   <tr>
  69  *     <td style="width:10%">&nbsp;
  70  *     <td style="width:27%">{@link #STAPLE_BOTTOM_LEFT STAPLE_BOTTOM_LEFT}
  71  *     <td style="width:27%">{@link #EDGE_STITCH_TOP EDGE_STITCH_TOP}
  72  *     <td style="width:27%">{@link #STAPLE_DUAL_TOP STAPLE_DUAL_TOP}
  73  *     <td style="width:9%">&nbsp;
  74  *   <tr>
  75  *     <td style="width:10%">&nbsp;
  76  *     <td style="width:27%">{@link #STAPLE_TOP_RIGHT STAPLE_TOP_RIGHT}
  77  *     <td style="width:27%">{@link #EDGE_STITCH_RIGHT EDGE_STITCH_RIGHT}
  78  *     <td style="width:27%">{@link #STAPLE_DUAL_RIGHT STAPLE_DUAL_RIGHT}
  79  *     <td style="width:9%">&nbsp;
  80  *   <tr>
  81  *     <td style="width:10%">&nbsp;
  82  *     <td style="width:27%">{@link #STAPLE_BOTTOM_RIGHT STAPLE_BOTTOM_RIGHT}
  83  *     <td style="width:27%">{@link #EDGE_STITCH_BOTTOM EDGE_STITCH_BOTTOM}
  84  *     <td style="width:27%">{@link #STAPLE_DUAL_BOTTOM STAPLE_DUAL_BOTTOM}
  85  *     <td style="width:9%">&nbsp;
  86  * </table>
  87  * <p>
  88  * The STAPLE_<i>XXX</i> values are specified with respect to the document as if
  89  * the document were a portrait document. If the document is actually a
  90  * landscape or a reverse-landscape document, the client supplies the












































  91  * appropriate transformed value. For example, to position a staple in the upper
  92  * left hand corner of a landscape document when held for reading, the client
  93  * supplies the {@code STAPLE_BOTTOM_LEFT} value (since landscape is defined as
  94  * a +90 degree rotation from portrait, i.e., anti-clockwise). On the other
  95  * hand, to position a staple in the upper left hand corner of a
  96  * reverse-landscape document when held for reading, the client supplies the
  97  * {@code STAPLE_TOP_RIGHT} value (since reverse-landscape is defined as a -90
  98  * degree rotation from portrait, i.e., clockwise).
  99  * <p>
 100  * The angle (vertical, horizontal, angled) of each staple with respect to the
 101  * document depends on the implementation which may in turn depend on the value
 102  * of the attribute.
 103  * <p>
 104  * The effect of a {@code Finishings} attribute on a multidoc print job (a job
 105  * with multiple documents) depends on whether all the docs have the same
 106  * binding specified or whether different docs have different bindings
 107  * specified, and on the (perhaps defaulted) value of the
 108  * {@link MultipleDocumentHandling MultipleDocumentHandling} attribute.
 109  * <ul>
 110  *   <li>If all the docs have the same binding specified, then any value of
 111  *   {@link MultipleDocumentHandling MultipleDocumentHandling} makes sense, and
 112  *   the printer's processing depends on the
 113  *   {@link MultipleDocumentHandling MultipleDocumentHandling} value:
 114  *   <ul>
 115  *     <li>{@code SINGLE_DOCUMENT} -- All the input docs will be bound together
 116  *     as one output document with the specified binding.
 117  *     <li>{@code SINGLE_DOCUMENT_NEW_SHEET} -- All the input docs will be bound
 118  *     together as one output document with the specified binding, and the first
 119  *     impression of each input doc will always start on a new media sheet.
 120  *     <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- Each input doc will
 121  *     be bound separately with the specified binding.
 122  *     <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- Each input doc will be
 123  *     bound separately with the specified binding.
 124  *   </ul>
 125  *   <li>If different docs have different bindings specified, then only two
 126  *   values of {@link MultipleDocumentHandling MultipleDocumentHandling} make
 127  *   sense, and the printer reports an error when the job is submitted if any
 128  *   other value is specified:
 129  *   <ul>
 130  *     <li>{@code SEPARATE_DOCUMENTS_UNCOLLATED_COPIES} -- Each input doc will
 131  *     be bound separately with its own specified binding.
 132  *     <li>{@code SEPARATE_DOCUMENTS_COLLATED_COPIES} -- Each input doc will be
 133  *     bound separately with its own specified binding.
 134  *   </ul>
 135  * </ul>
 136  * <p>
 137  * <b>IPP Compatibility:</b> Class Finishings encapsulates some of the IPP enum
 138  * values that can be included in an IPP "finishings" attribute, which is a set
 139  * of enums. The category name returned by {@code getName()} is the IPP
 140  * attribute name. The enumeration's integer value is the IPP enum value. The
 141  * {@code toString()} method returns the IPP string representation of the
 142  * attribute value. In IPP Finishings is a multi-value attribute, this API
 143  * currently allows only one binding to be specified.














 144  *
 145  * @author Alan Kaminsky
 146  */
 147 public class Finishings extends EnumSyntax
 148     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
 149 
 150     /**
 151      * Use serialVersionUID from JDK 1.4 for interoperability.
 152      */
 153     private static final long serialVersionUID = -627840419548391754L;
 154 
 155     /**
 156      * Perform no binding.
 157      */
 158     public static final Finishings NONE = new Finishings(3);
 159 
 160     /**
 161      * Bind the document(s) with one or more staples. The exact number and
 162      * placement of the staples is site-defined.
 163      */
 164     public static final Finishings STAPLE = new Finishings(4);
 165 
 166     /**
 167      * This value is specified when it is desired to select a non-printed (or
 168      * pre-printed) cover for the document. This does not supplant the
 169      * specification of a printed cover (on cover stock medium) by the document
 170      * itself.
 171      */
 172     public static final Finishings COVER = new Finishings(6);
 173 
 174     /**
 175      * This value indicates that a binding is to be applied to the document; the
 176      * type and placement of the binding is site-defined.
 177      */
 178     public static final Finishings BIND = new Finishings(7);
 179 
 180     /**
 181      * Bind the document(s) with one or more staples (wire stitches) along the
 182      * middle fold. The exact number and placement of the staples and the middle
 183      * fold is implementation- and/or site-defined.
 184      */
 185     public static final Finishings SADDLE_STITCH =
 186         new Finishings(8);
 187 
 188     /**
 189      * Bind the document(s) with one or more staples (wire stitches) along one
 190      * edge. The exact number and placement of the staples is implementation-
 191      * and/or site- defined.
 192      */
 193     public static final Finishings EDGE_STITCH =
 194         new Finishings(9);
 195 
 196     /**
 197      * Bind the document(s) with one or more staples in the top left corner.
 198      */
 199     public static final Finishings STAPLE_TOP_LEFT =
 200         new Finishings(20);
 201 
 202     /**
 203      * Bind the document(s) with one or more staples in the bottom left corner.

 204      */
 205     public static final Finishings STAPLE_BOTTOM_LEFT =
 206         new Finishings(21);
 207 
 208     /**
 209      * Bind the document(s) with one or more staples in the top right corner.
 210      */
 211     public static final Finishings STAPLE_TOP_RIGHT =
 212         new Finishings(22);
 213 
 214     /**
 215      * Bind the document(s) with one or more staples in the bottom right corner.

 216      */
 217     public static final Finishings STAPLE_BOTTOM_RIGHT =
 218         new Finishings(23);
 219 
 220     /**
 221      * Bind the document(s) with one or more staples (wire stitches) along the
 222      * left edge. The exact number and placement of the staples is
 223      * implementation- and/or site-defined.
 224      */
 225     public static final Finishings EDGE_STITCH_LEFT =
 226         new Finishings(24);
 227 
 228     /**
 229      * Bind the document(s) with one or more staples (wire stitches) along the
 230      * top edge. The exact number and placement of the staples is
 231      * implementation- and/or site-defined.
 232      */
 233     public static final Finishings EDGE_STITCH_TOP =
 234         new Finishings(25);
 235 
 236     /**
 237      * Bind the document(s) with one or more staples (wire stitches) along the
 238      * right edge. The exact number and placement of the staples is
 239      * implementation- and/or site-defined.
 240      */
 241     public static final Finishings EDGE_STITCH_RIGHT =
 242         new Finishings(26);
 243 
 244     /**
 245      * Bind the document(s) with one or more staples (wire stitches) along the
 246      * bottom edge. The exact number and placement of the staples is
 247      * implementation- and/or site-defined.
 248      */
 249     public static final Finishings EDGE_STITCH_BOTTOM =
 250         new Finishings(27);
 251 
 252     /**
 253      * Bind the document(s) with two staples (wire stitches) along the left edge
 254      * assuming a portrait document (see above).
 255      */
 256     public static final Finishings STAPLE_DUAL_LEFT =
 257         new Finishings(28);
 258 
 259     /**
 260      * Bind the document(s) with two staples (wire stitches) along the top edge
 261      * assuming a portrait document (see above).
 262      */
 263     public static final Finishings STAPLE_DUAL_TOP =
 264         new Finishings(29);
 265 
 266     /**
 267      * Bind the document(s) with two staples (wire stitches) along the right
 268      * edge assuming a portrait document (see above).
 269      */
 270     public static final Finishings STAPLE_DUAL_RIGHT =
 271         new Finishings(30);
 272 
 273     /**
 274      * Bind the document(s) with two staples (wire stitches) along the bottom
 275      * edge assuming a portrait document (see above).
 276      */
 277     public static final Finishings STAPLE_DUAL_BOTTOM =
 278         new Finishings(31);
 279 
 280     /**
 281      * Construct a new finishings binding enumeration value with the given
 282      * integer value.
 283      *
 284      * @param  value Integer value
 285      */
 286     protected Finishings(int value) {
 287         super(value);
 288     }
 289 
 290     /**
 291      * The string table for class {@code Finishings}.
 292      */
 293     private static final String[] myStringTable =
 294                 {"none",
 295                  "staple",
 296                  null,
 297                  "cover",
 298                  "bind",
 299                  "saddle-stitch",
 300                  "edge-stitch",
 301                  null, // The next ten enum values are reserved.
 302                  null,
 303                  null,
 304                  null,
 305                  null,
 306                  null,
 307                  null,
 308                  null,
 309                  null,
 310                  null,
 311                  "staple-top-left",
 312                  "staple-bottom-left",
 313                  "staple-top-right",
 314                  "staple-bottom-right",
 315                  "edge-stitch-left",
 316                  "edge-stitch-top",
 317                  "edge-stitch-right",
 318                  "edge-stitch-bottom",
 319                  "staple-dual-left",
 320                  "staple-dual-top",
 321                  "staple-dual-right",
 322                  "staple-dual-bottom"
 323                 };
 324 
 325     /**
 326      * The enumeration value table for class {@code Finishings}.
 327      */
 328     private static final Finishings[] myEnumValueTable =
 329                 {NONE,
 330                  STAPLE,
 331                  null,
 332                  COVER,
 333                  BIND,
 334                  SADDLE_STITCH,
 335                  EDGE_STITCH,
 336                  null, // The next ten enum values are reserved.
 337                  null,
 338                  null,
 339                  null,
 340                  null,
 341                  null,
 342                  null,
 343                  null,
 344                  null,
 345                  null,
 346                  STAPLE_TOP_LEFT,
 347                  STAPLE_BOTTOM_LEFT,
 348                  STAPLE_TOP_RIGHT,
 349                  STAPLE_BOTTOM_RIGHT,
 350                  EDGE_STITCH_LEFT,
 351                  EDGE_STITCH_TOP,
 352                  EDGE_STITCH_RIGHT,
 353                  EDGE_STITCH_BOTTOM,
 354                  STAPLE_DUAL_LEFT,
 355                  STAPLE_DUAL_TOP,
 356                  STAPLE_DUAL_RIGHT,
 357                  STAPLE_DUAL_BOTTOM
 358                 };
 359 
 360     /**
 361      * Returns the string table for class {@code Finishings}.
 362      */
 363     protected String[] getStringTable() {
 364         return myStringTable.clone();
 365     }
 366 
 367     /**
 368      * Returns the enumeration value table for class {@code Finishings}.
 369      */
 370     protected EnumSyntax[] getEnumValueTable() {
 371         return (EnumSyntax[])myEnumValueTable.clone();
 372     }
 373 
 374     /**
 375      * Returns the lowest integer value used by class {@code Finishings}.
 376      */
 377     protected int getOffset() {
 378         return 3;
 379     }
 380 
 381     /**
 382      * Get the printing attribute class which is to be used as the "category"
 383      * for this printing attribute value.
 384      * <p>
 385      * For class {@code Finishings} and any vendor-defined subclasses, the
 386      * category is class {@code Finishings} itself.
 387      *
 388      * @return printing attribute class (category), an instance of class
 389      *         {@link Class java.lang.Class}
 390      */
 391     public final Class<? extends Attribute> getCategory() {
 392         return Finishings.class;
 393     }
 394 
 395     /**
 396      * Get the name of the category of which this attribute value is an
 397      * instance.
 398      * <p>
 399      * For class {@code Finishings} and any vendor-defined subclasses, the
 400      * category name is {@code "finishings"}.
 401      *
 402      * @return attribute category name
 403      */
 404     public final String getName() {
 405         return "finishings";
 406     }

 407 }
< prev index next >