KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > MediaTray


1 /*
2  * @(#)MediaTray.java 1.8 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import java.util.Locale JavaDoc;
10
11 import javax.print.attribute.Attribute JavaDoc;
12 import javax.print.attribute.EnumSyntax JavaDoc;
13
14
15 /**
16  * Class MediaTray is a subclass of Media.
17  * Class MediaTray is a printing attribute class, an enumeration, that
18  * specifies the media tray or bin for the job.
19  * This attribute can be used instead of specifying MediaSize or MediaName.
20  * <p>
21  * Class MediaTray declares keywords for standard media kind values.
22  * Implementation- or site-defined names for a media kind attribute may also
23  * be created by defining a subclass of class MediaTray.
24  * <P>
25  * <B>IPP Compatibility:</B> MediaTray is a representation class for
26  * values of the IPP "media" attribute which name paper trays.
27  * <P>
28  *
29  */

30 public class MediaTray extends Media JavaDoc implements Attribute JavaDoc {
31
32     private static final long serialVersionUID = -982503611095214703L;
33
34     /**
35      * The top input tray in the printer.
36      */

37     public static final MediaTray JavaDoc TOP = new MediaTray JavaDoc(0);
38
39     /**
40      * The middle input tray in the printe.
41      */

42     public static final MediaTray JavaDoc MIDDLE = new MediaTray JavaDoc(1);
43
44     /**
45      * The bottom input tray in the printer.
46      */

47     public static final MediaTray JavaDoc BOTTOM = new MediaTray JavaDoc(2);
48
49     /**
50      * The envelope input tray in the printer.
51      */

52     public static final MediaTray JavaDoc ENVELOPE = new MediaTray JavaDoc(3);
53
54     /**
55      * The manual feed input tray in the printer.
56      */

57     public static final MediaTray JavaDoc MANUAL = new MediaTray JavaDoc(4);
58
59     /**
60      * The large capacity input tray in the printer.
61      */

62     public static final MediaTray JavaDoc LARGE_CAPACITY = new MediaTray JavaDoc(5);
63
64     /**
65      * The main input tray in the printer.
66      */

67     public static final MediaTray JavaDoc MAIN = new MediaTray JavaDoc(6);
68
69     /**
70      * The side input tray.
71      */

72     public static final MediaTray JavaDoc SIDE = new MediaTray JavaDoc(7);
73     
74     /**
75      * Construct a new media tray enumeration value with the given integer
76      * value.
77      *
78      * @param value Integer value.
79      */

80     protected MediaTray(int value) {
81     super (value);
82     }
83
84     private static final String JavaDoc[] myStringTable ={
85     "top",
86     "middle",
87     "bottom",
88     "envelope",
89     "manual",
90     "large-capacity",
91     "main",
92     "side"
93     };
94
95     private static final MediaTray JavaDoc[] myEnumValueTable = {
96     TOP,
97     MIDDLE,
98     BOTTOM,
99     ENVELOPE,
100     MANUAL,
101     LARGE_CAPACITY,
102     MAIN,
103     SIDE
104     };
105
106     /**
107      * Returns the string table for class MediaTray.
108      */

109     protected String JavaDoc[] getStringTable()
110     {
111     return (String JavaDoc[])myStringTable.clone();
112     }
113
114     /**
115      * Returns the enumeration value table for class MediaTray.
116      */

117     protected EnumSyntax JavaDoc[] getEnumValueTable() {
118     return (EnumSyntax JavaDoc[])myEnumValueTable.clone();
119     }
120
121
122 }
123
Popular Tags