KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)MediaName.java 1.9 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 import javax.print.attribute.Attribute JavaDoc;
11 import javax.print.attribute.EnumSyntax JavaDoc;
12
13 /**
14  * Class MediaName is a subclass of Media, a printing attribute class (an
15  * enumeration) that specifies the media for a print job as a name.
16  * <P>
17  * This attribute can be used instead of specifying MediaSize or MediaTray.
18  * <p>
19  * Class MediaName currently declares a few standard media names.
20  * Implementation- or site-defined names for a media name attribute may also
21  * be created by defining a subclass of class MediaName.
22  * <P>
23  * <B>IPP Compatibility:</B> MediaName is a representation class for
24  * values of the IPP "media" attribute which names media.
25  * <P>
26  *
27  */

28 public class MediaName extends Media JavaDoc implements Attribute JavaDoc {
29
30     private static final long serialVersionUID = 4653117714524155448L;
31
32     /**
33      * white letter paper.
34      */

35     public static final MediaName JavaDoc NA_LETTER_WHITE = new MediaName JavaDoc(0);
36
37     /**
38      * letter transparency.
39      */

40     public static final MediaName JavaDoc NA_LETTER_TRANSPARENT = new MediaName JavaDoc(1);
41
42     /**
43      * white A4 paper.
44      */

45     public static final MediaName JavaDoc ISO_A4_WHITE = new MediaName JavaDoc(2);
46
47
48     /**
49      * A4 transparency.
50      */

51     public static final MediaName JavaDoc ISO_A4_TRANSPARENT= new MediaName JavaDoc(3);
52
53
54     /**
55      * Constructs a new media name enumeration value with the given integer
56      * value.
57      *
58      * @param value Integer value.
59      */

60     protected MediaName(int value) {
61     super (value);
62     }
63
64     private static final String JavaDoc[] myStringTable = {
65     "na-letter-white",
66     "na-letter-transparent",
67     "iso-a4-white",
68     "iso-a4-transparent"
69     };
70
71     private static final MediaName JavaDoc[] myEnumValueTable = {
72     NA_LETTER_WHITE,
73     NA_LETTER_TRANSPARENT,
74     ISO_A4_WHITE,
75     ISO_A4_TRANSPARENT
76     };
77
78     /**
79      * Returns the string table for class MediaTray.
80      * @return the String table.
81      */

82     protected String JavaDoc[] getStringTable()
83     {
84     return (String JavaDoc[])myStringTable.clone();
85     }
86
87     /**
88      * Returns the enumeration value table for class MediaTray.
89      * @return the enumeration value table.
90      */

91     protected EnumSyntax JavaDoc[] getEnumValueTable() {
92     return (EnumSyntax JavaDoc[])myEnumValueTable.clone();
93     }
94
95 }
96
Popular Tags