KickJava   Java API By Example, From Geeks To Geeks.

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


1
2 /*
3  * @(#)Chromaticity.java 1.9 04/05/05
4  *
5  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
6  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
7  */

8 package javax.print.attribute.standard;
9
10 import javax.print.attribute.Attribute JavaDoc;
11 import javax.print.attribute.EnumSyntax JavaDoc;
12 import javax.print.attribute.DocAttribute JavaDoc;
13 import javax.print.attribute.PrintRequestAttribute JavaDoc;
14 import javax.print.attribute.PrintJobAttribute JavaDoc;
15
16 /**
17  * Class Chromaticity is a printing attribute class, an enumeration, that
18  * specifies monochrome or color printing. This is used by a print client
19  * to specify how the print data should be generated or processed. It is not
20  * descriptive of the color capabilities of the device. Query the service's
21  * {@link ColorSupported ColorSupported} attribute to determine if the device
22  * can be verified to support color printing.
23  * <P>
24  * The table below shows the effects of specifying a Chromaticity attribute of
25  * {@link #MONOCHROME <CODE>MONOCHROME</CODE>} or {@link #COLOR
26  * <CODE>COLOR</CODE>} for a monochrome or color document.
27  * <P>
28  * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes">
29  * <TR BGCOLOR="#E5E5E5">
30  * <TH>
31  * Chromaticity<BR>Attribute
32  * </TH>
33  * <TH>
34  * Effect on<BR>Monochrome Document
35  * </TH>
36  * <TH>
37  * Effect on<BR>Color Document
38  * </TH>
39  * </TR>
40  * <TR>
41  * <TD>
42  * {@link #MONOCHROME <CODE>MONOCHROME</CODE>}
43  * </TD>
44  * <TD>
45  * Printed as is, in monochrome
46  * </TD>
47  * <TD>
48  * Printed in monochrome, with colors converted to shades of gray
49  * </TD>
50  * </TR>
51  * <TR>
52  * <TD>
53  * {@link #COLOR <CODE>COLOR</CODE>}
54  * </TD>
55  * <TD>
56  * Printed as is, in monochrome
57  * </TD>
58  * <TD>
59  * Printed as is, in color
60  * </TD>
61  * </TR>
62  * </TABLE>
63  * <P>
64  * <P>
65  * <B>IPP Compatibility:</B> Chromaticity is not an IPP attribute at present.
66  * <P>
67  *
68  * @author Alan Kaminsky
69  */

70 public final class Chromaticity extends EnumSyntax JavaDoc
71     implements DocAttribute JavaDoc, PrintRequestAttribute JavaDoc, PrintJobAttribute JavaDoc {
72
73     private static final long serialVersionUID = 4660543931355214012L;
74
75     /**
76      * Monochrome printing.
77      */

78     public static final Chromaticity JavaDoc MONOCHROME = new Chromaticity JavaDoc(0);
79
80     /**
81      * Color printing.
82      */

83     public static final Chromaticity JavaDoc COLOR = new Chromaticity JavaDoc(1);
84
85
86     /**
87      * Construct a new chromaticity enumeration value with the given integer
88      * value.
89      *
90      * @param value Integer value.
91      */

92     protected Chromaticity(int value) {
93     super(value);
94     }
95
96     private static final String JavaDoc[] myStringTable = {"monochrome",
97                            "color"};
98
99     private static final Chromaticity JavaDoc[] myEnumValueTable = {MONOCHROME,
100                                 COLOR};
101
102     /**
103      * Returns the string table for class Chromaticity.
104      */

105     protected String JavaDoc[] getStringTable() {
106     return myStringTable;
107     }
108
109     /**
110      * Returns the enumeration value table for class Chromaticity.
111      */

112     protected EnumSyntax JavaDoc[] getEnumValueTable() {
113     return myEnumValueTable;
114     }
115
116     /**
117      * Get the printing attribute class which is to be used as the "category"
118      * for this printing attribute value.
119      * <P>
120      * For class Chromaticity, the category is the class Chromaticity itself.
121      *
122      * @return Printing attribute class (category), an instance of class
123      * {@link java.lang.Class java.lang.Class}.
124      */

125     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
126     return Chromaticity JavaDoc.class;
127     }
128
129     /**
130      * Get the name of the category of which this attribute value is an
131      * instance.
132      * <P>
133      * For class Chromaticity, the category name is <CODE>"chromaticity"</CODE>.
134      *
135      * @return Attribute category name.
136      */

137     public final String JavaDoc getName() {
138         return "chromaticity";
139     }
140
141     }
142
Popular Tags