blob: 4d96a00538ac955494ce4d560a91730fa4a28e0a [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001
2/*
3 * Copyright 2000-2004 Sun Microsystems, Inc. All Rights Reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation. Sun designates this
9 * particular file as subject to the "Classpath" exception as provided
10 * by Sun in the LICENSE file that accompanied this code.
11 *
12 * This code is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * version 2 for more details (a copy is included in the LICENSE file that
16 * accompanied this code).
17 *
18 * You should have received a copy of the GNU General Public License version
19 * 2 along with this work; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
23 * CA 95054 USA or visit www.sun.com if you need additional information or
24 * have any questions.
25 */
26package javax.print.attribute.standard;
27
28import javax.print.attribute.Attribute;
29import javax.print.attribute.EnumSyntax;
30import javax.print.attribute.DocAttribute;
31import javax.print.attribute.PrintRequestAttribute;
32import javax.print.attribute.PrintJobAttribute;
33
34/**
35 * Class Chromaticity is a printing attribute class, an enumeration, that
36 * specifies monochrome or color printing. This is used by a print client
37 * to specify how the print data should be generated or processed. It is not
38 * descriptive of the color capabilities of the device. Query the service's
39 * {@link ColorSupported ColorSupported} attribute to determine if the device
40 * can be verified to support color printing.
41 * <P>
42 * The table below shows the effects of specifying a Chromaticity attribute of
43 * {@link #MONOCHROME <CODE>MONOCHROME</CODE>} or {@link #COLOR
44 * <CODE>COLOR</CODE>} for a monochrome or color document.
45 * <P>
46 * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes">
47 * <TR BGCOLOR="#E5E5E5">
48 * <TH>
49 * Chromaticity<BR>Attribute
50 * </TH>
51 * <TH>
52 * Effect on<BR>Monochrome Document
53 * </TH>
54 * <TH>
55 * Effect on<BR>Color Document
56 * </TH>
57 * </TR>
58 * <TR>
59 * <TD>
60 * {@link #MONOCHROME <CODE>MONOCHROME</CODE>}
61 * </TD>
62 * <TD>
63 * Printed as is, in monochrome
64 * </TD>
65 * <TD>
66 * Printed in monochrome, with colors converted to shades of gray
67 * </TD>
68 * </TR>
69 * <TR>
70 * <TD>
71 * {@link #COLOR <CODE>COLOR</CODE>}
72 * </TD>
73 * <TD>
74 * Printed as is, in monochrome
75 * </TD>
76 * <TD>
77 * Printed as is, in color
78 * </TD>
79 * </TR>
80 * </TABLE>
81 * <P>
82 * <P>
83 * <B>IPP Compatibility:</B> Chromaticity is not an IPP attribute at present.
84 * <P>
85 *
86 * @author Alan Kaminsky
87 */
88public final class Chromaticity extends EnumSyntax
89 implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
90
91 private static final long serialVersionUID = 4660543931355214012L;
92
93 /**
94 * Monochrome printing.
95 */
96 public static final Chromaticity MONOCHROME = new Chromaticity(0);
97
98 /**
99 * Color printing.
100 */
101 public static final Chromaticity COLOR = new Chromaticity(1);
102
103
104 /**
105 * Construct a new chromaticity enumeration value with the given integer
106 * value.
107 *
108 * @param value Integer value.
109 */
110 protected Chromaticity(int value) {
111 super(value);
112 }
113
114 private static final String[] myStringTable = {"monochrome",
115 "color"};
116
117 private static final Chromaticity[] myEnumValueTable = {MONOCHROME,
118 COLOR};
119
120 /**
121 * Returns the string table for class Chromaticity.
122 */
123 protected String[] getStringTable() {
124 return myStringTable;
125 }
126
127 /**
128 * Returns the enumeration value table for class Chromaticity.
129 */
130 protected EnumSyntax[] getEnumValueTable() {
131 return myEnumValueTable;
132 }
133
134 /**
135 * Get the printing attribute class which is to be used as the "category"
136 * for this printing attribute value.
137 * <P>
138 * For class Chromaticity, the category is the class Chromaticity itself.
139 *
140 * @return Printing attribute class (category), an instance of class
141 * {@link java.lang.Class java.lang.Class}.
142 */
143 public final Class<? extends Attribute> getCategory() {
144 return Chromaticity.class;
145 }
146
147 /**
148 * Get the name of the category of which this attribute value is an
149 * instance.
150 * <P>
151 * For class Chromaticity, the category name is <CODE>"chromaticity"</CODE>.
152 *
153 * @return Attribute category name.
154 */
155 public final String getName() {
156 return "chromaticity";
157 }
158
159 }