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