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 OrientationRequested is a printing attribute class, an enumeration,
35 * that indicates the desired orientation for printed print-stream pages; it
36 * does not describe the orientation of the client-supplied print-stream
37 * pages.
38 * <P>
39 * For some document formats (such as <CODE>"application/postscript"</CODE>),
40 * the desired orientation of the print-stream pages is specified within the
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
88 * The content will be imaged across the long edge of the medium, but in
89 * the opposite manner from landscape. Reverse-landscape is defined to be
90 * a rotation of the print-stream page to be imaged by -90 degrees with
91 * respect to the medium (i.e. clockwise) from the portrait orientation.
92 * <I>Note:</I> The REVERSE_LANDSCAPE value was added because some
93 * applications rotate landscape -90 degrees from portrait, rather than
94 * +90 degrees.
95 */
96 public static final OrientationRequested
97 REVERSE_LANDSCAPE = new OrientationRequested(5);
98
99 /**
100 * The content will be imaged across the short edge of the medium, but in
101 * the opposite manner from portrait. Reverse-portrait is defined to be a
102 * rotation of the print-stream page to be imaged by 180 degrees with
103 * respect to the medium from the portrait orientation. <I>Note:</I> The
104 * REVERSE_PORTRAIT value was added for use with the {@link
105 * Finishings Finishings} attribute in cases where the
106 * opposite edge is desired for finishing a portrait document on simple
107 * finishing devices that have only one finishing position. Thus a
108 * <CODE>"text/plain"</CODE> portrait document can be stapled "on the
109 * right" by a simple finishing device as is common use with some
110 * Middle Eastern languages such as Hebrew.
111 */
112 public static final OrientationRequested
113 REVERSE_PORTRAIT = new OrientationRequested(6);
114
115 /**
116 * Construct a new orientation requested enumeration value with the given
117 * integer value.
118 *
119 * @param value Integer value.
120 */
121 protected OrientationRequested(int value) {
122 super(value);
123 }
124
125 private static final String[] myStringTable = {
126 "portrait",
127 "landscape",
128 "reverse-landscape",
159
160 /**
161 * Get the printing attribute class which is to be used as the "category"
162 * for this printing attribute value.
163 * <P>
164 * For class OrientationRequested, the
165 * category is class OrientationRequested itself.
166 *
167 * @return Printing attribute class (category), an instance of class
168 * {@link java.lang.Class java.lang.Class}.
169 */
170 public final Class<? extends Attribute> getCategory() {
171 return OrientationRequested.class;
172 }
173
174 /**
175 * Get the name of the category of which this attribute value is an
176 * instance.
177 * <P>
178 * For class OrientationRequested, the
179 * category name is <CODE>"orientation-requested"</CODE>.
180 *
181 * @return Attribute category name.
182 */
183 public final String getName() {
184 return "orientation-requested";
185 }
186
187 }
|
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 OrientationRequested is a printing attribute class, an enumeration,
35 * that indicates the desired orientation for printed print-stream pages; it
36 * does not describe the orientation of the client-supplied print-stream
37 * pages.
38 * <P>
39 * For some document formats (such as {@code "application/postscript"}),
40 * the desired orientation of the print-stream pages is specified within the
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"}) 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"} or {@code "text/html"}) but not others (e.g.
49 * {@code "application/postscript"}). 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()} is the IPP attribute name. The enumeration's
59 * integer value is the IPP enum value. The {@code toString()} 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
88 * The content will be imaged across the long edge of the medium, but in
89 * the opposite manner from landscape. Reverse-landscape is defined to be
90 * a rotation of the print-stream page to be imaged by -90 degrees with
91 * respect to the medium (i.e. clockwise) from the portrait orientation.
92 * <I>Note:</I> The REVERSE_LANDSCAPE value was added because some
93 * applications rotate landscape -90 degrees from portrait, rather than
94 * +90 degrees.
95 */
96 public static final OrientationRequested
97 REVERSE_LANDSCAPE = new OrientationRequested(5);
98
99 /**
100 * The content will be imaged across the short edge of the medium, but in
101 * the opposite manner from portrait. Reverse-portrait is defined to be a
102 * rotation of the print-stream page to be imaged by 180 degrees with
103 * respect to the medium from the portrait orientation. <I>Note:</I> The
104 * REVERSE_PORTRAIT value was added for use with the {@link
105 * Finishings Finishings} attribute in cases where the
106 * opposite edge is desired for finishing a portrait document on simple
107 * finishing devices that have only one finishing position. Thus a
108 * {@code "text/plain"} portrait document can be stapled "on the
109 * right" by a simple finishing device as is common use with some
110 * Middle Eastern languages such as Hebrew.
111 */
112 public static final OrientationRequested
113 REVERSE_PORTRAIT = new OrientationRequested(6);
114
115 /**
116 * Construct a new orientation requested enumeration value with the given
117 * integer value.
118 *
119 * @param value Integer value.
120 */
121 protected OrientationRequested(int value) {
122 super(value);
123 }
124
125 private static final String[] myStringTable = {
126 "portrait",
127 "landscape",
128 "reverse-landscape",
159
160 /**
161 * Get the printing attribute class which is to be used as the "category"
162 * for this printing attribute value.
163 * <P>
164 * For class OrientationRequested, the
165 * category is class OrientationRequested itself.
166 *
167 * @return Printing attribute class (category), an instance of class
168 * {@link java.lang.Class java.lang.Class}.
169 */
170 public final Class<? extends Attribute> getCategory() {
171 return OrientationRequested.class;
172 }
173
174 /**
175 * Get the name of the category of which this attribute value is an
176 * instance.
177 * <P>
178 * For class OrientationRequested, the
179 * category name is {@code "orientation-requested"}.
180 *
181 * @return Attribute category name.
182 */
183 public final String getName() {
184 return "orientation-requested";
185 }
186
187 }
|