API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.print.attribute.standard. OrientationRequested View Javadoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

/*
 * @(#)OrientationRequested.java	1.10 05/11/17
 *
 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
 * SUN 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 OrientationRequested is a printing attribute class, an enumeration, 
 * that indicates the desired orientation for printed print-stream pages; it 
 * does not describe the orientation of the client-supplied print-stream
 * pages. 
 * <P>
 * For some document formats (such as <CODE>"application/postscript"</CODE>), 
 * the desired orientation of the print-stream pages is specified within the 
 * document data. This information is generated by a device driver prior to  
 * the submission of the print job. Other document formats (such as 
 * <CODE>"text/plain"</CODE>) do not include the notion of desired orientation 
 * within the document data. In the latter case it is possible for the printer 
 * to bind the desired orientation to the document data after it has been 
 * submitted. It is expected that a printer would only support the 
 * OrientationRequested attribute for some document formats (e.g., 
 * <CODE>"text/plain"</CODE> or <CODE>"text/html"</CODE>) but not others (e.g. 
 * <CODE>"application/postscript"</CODE>). This is no different from any other 
 * job template attribute, since a print job can always impose constraints
 * among the values of different job template attributes.
 *  However, a special mention 
 * is made here since it is very likely that a printer will support the 
 * OrientationRequested attribute for only a subset of the supported document 
 * formats. 
 * <P>
 * <B>IPP Compatibility:</B> The category name returned by 
 * <CODE>getName()</CODE> is the IPP attribute name.  The enumeration's 
 * integer value is the IPP enum value.  The <code>toString()</code> method 
 * returns the IPP string representation of the attribute value.
 * <P>
 *
 * @author  Alan Kaminsky
 */
public final class OrientationRequested extends EnumSyntax
    implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {

    private static final long serialVersionUID = -4447437289862822276L;

    /**
     * The content will be imaged across the short edge of the medium. 
     */
    public static final OrientationRequested
	PORTRAIT = new OrientationRequested(3);

    /**
     * The content will be imaged across the long edge of the medium.
     * Landscape is defined to be a rotation of the print-stream page to be
     * imaged by +90 degrees with respect to the medium
     * (i.e. anti-clockwise) from the 
     * portrait orientation. <I>Note:</I> The +90 direction was chosen because 
     * simple finishing on the long edge is the same edge whether portrait or 
     * landscape. 
     */
    public static final OrientationRequested
	LANDSCAPE = new OrientationRequested(4);

    /**
     * The content will be imaged across the long edge of the medium, but in 
     * the opposite manner from landscape. Reverse-landscape is defined to be 
     * a rotation of the print-stream page to be imaged by -90 degrees with 
     * respect to the medium (i.e. clockwise) from the portrait orientation. 
     * <I>Note:</I> The REVERSE_LANDSCAPE value was added because some 
     * applications rotate landscape -90 degrees from portrait, rather than
     * +90 degrees. 
     */
    public static final OrientationRequested
	REVERSE_LANDSCAPE = new OrientationRequested(5);

    /**
     * The content will be imaged across the short edge of the medium, but in 
     * the opposite manner from portrait. Reverse-portrait is defined to be a 
     * rotation of the print-stream page to be imaged by 180 degrees with 
     * respect to the medium from the portrait orientation. <I>Note:</I> The 
     * REVERSE_PORTRAIT value was added for use with the {@link 
     * Finishings Finishings} attribute in cases where the 
     * opposite edge is desired for finishing a portrait document on simple 
     * finishing devices that have only one finishing position. Thus a 
     * <CODE>"text/plain"</CODE> portrait document can be stapled "on the
     * right" by a simple finishing device as is common use with some 
     * Middle Eastern languages such as Hebrew. 
     */
    public static final OrientationRequested
	REVERSE_PORTRAIT = new OrientationRequested(6);

    /**
     * Construct a new orientation requested enumeration value with the given 
     * integer value. 
     *
     * @param  value  Integer value.
     */
    protected OrientationRequested(int value) {
	super(value);
    }

    private static final String[] myStringTable = {
	"portrait",
	"landscape",
	"reverse-landscape",
	"reverse-portrait"
    };

    private static final OrientationRequested[] myEnumValueTable = {
	PORTRAIT,
	LANDSCAPE,
	REVERSE_LANDSCAPE,
	REVERSE_PORTRAIT
    };

    /**
     * Returns the string table for class OrientationRequested.
     */
    protected String[] getStringTable() {
	return myStringTable;
    }

    /**
     * Returns the enumeration value table for class OrientationRequested.
     */
    protected EnumSyntax[] getEnumValueTable() {
	return myEnumValueTable;
    }

    /**
     * Returns the lowest integer value used by class OrientationRequested.
     */
    protected int getOffset() {
	return 3;
    } 

    /**
     * Get the printing attribute class which is to be used as the "category" 
     * for this printing attribute value.
     * <P>
     * For class OrientationRequested, the 
     * category is class OrientationRequested itself. 
     *
     * @return  Printing attribute class (category), an instance of class
     *          {@link java.lang.Class java.lang.Class}.
     */
    public final Class<? extends Attribute> getCategory() {
	return OrientationRequested.class;
    }

    /**
     * Get the name of the category of which this attribute value is an 
     * instance. 
     * <P>
     * For class OrientationRequested, the 
     * category name is <CODE>"orientation-requested"</CODE>.
     *
     * @return  Attribute category name.
     */
    public final String getName() {
	return "orientation-requested";
    }

}

Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar