src/share/classes/javax/print/attribute/standard/OrientationRequested.java

Print this page


   1 /*
   2  * Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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


  41  * document data. This information is generated by a device driver prior to
  42  * the submission of the print job. Other document formats (such as
  43  * <CODE>"text/plain"</CODE>) do not include the notion of desired orientation
  44  * within the document data. In the latter case it is possible for the printer
  45  * to bind the desired orientation to the document data after it has been
  46  * submitted. It is expected that a printer would only support the
  47  * OrientationRequested attribute for some document formats (e.g.,
  48  * <CODE>"text/plain"</CODE> or <CODE>"text/html"</CODE>) but not others (e.g.
  49  * <CODE>"application/postscript"</CODE>). This is no different from any other
  50  * job template attribute, since a print job can always impose constraints
  51  * among the values of different job template attributes.
  52  *  However, a special mention
  53  * is made here since it is very likely that a printer will support the
  54  * OrientationRequested attribute for only a subset of the supported document
  55  * formats.
  56  * <P>
  57  * <B>IPP Compatibility:</B> The category name returned by
  58  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  59  * integer value is the IPP enum value.  The <code>toString()</code> method
  60  * returns the IPP string representation of the attribute value.
  61  * <P>
  62  *
  63  * @author  Alan Kaminsky
  64  */
  65 public final class OrientationRequested extends EnumSyntax
  66     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
  67 
  68     private static final long serialVersionUID = -4447437289862822276L;
  69 
  70     /**
  71      * The content will be imaged across the short edge of the medium.
  72      */
  73     public static final OrientationRequested
  74         PORTRAIT = new OrientationRequested(3);
  75 
  76     /**
  77      * The content will be imaged across the long edge of the medium.
  78      * Landscape is defined to be a rotation of the print-stream page to be
  79      * imaged by +90 degrees with respect to the medium
  80      * (i.e. anti-clockwise) from the
  81      * portrait orientation. <I>Note:</I> The +90 direction was chosen because


   1 /*
   2  * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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


  41  * document data. This information is generated by a device driver prior to
  42  * the submission of the print job. Other document formats (such as
  43  * <CODE>"text/plain"</CODE>) do not include the notion of desired orientation
  44  * within the document data. In the latter case it is possible for the printer
  45  * to bind the desired orientation to the document data after it has been
  46  * submitted. It is expected that a printer would only support the
  47  * OrientationRequested attribute for some document formats (e.g.,
  48  * <CODE>"text/plain"</CODE> or <CODE>"text/html"</CODE>) but not others (e.g.
  49  * <CODE>"application/postscript"</CODE>). This is no different from any other
  50  * job template attribute, since a print job can always impose constraints
  51  * among the values of different job template attributes.
  52  *  However, a special mention
  53  * is made here since it is very likely that a printer will support the
  54  * OrientationRequested attribute for only a subset of the supported document
  55  * formats.
  56  * <P>
  57  * <B>IPP Compatibility:</B> The category name returned by
  58  * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's
  59  * integer value is the IPP enum value.  The <code>toString()</code> method
  60  * returns the IPP string representation of the attribute value.

  61  *
  62  * @author  Alan Kaminsky
  63  */
  64 public final class OrientationRequested extends EnumSyntax
  65     implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
  66 
  67     private static final long serialVersionUID = -4447437289862822276L;
  68 
  69     /**
  70      * The content will be imaged across the short edge of the medium.
  71      */
  72     public static final OrientationRequested
  73         PORTRAIT = new OrientationRequested(3);
  74 
  75     /**
  76      * The content will be imaged across the long edge of the medium.
  77      * Landscape is defined to be a rotation of the print-stream page to be
  78      * imaged by +90 degrees with respect to the medium
  79      * (i.e. anti-clockwise) from the
  80      * portrait orientation. <I>Note:</I> The +90 direction was chosen because