Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/classes/javax/print/attribute/standard/Chromaticity.java
38918 views
1/*2* Copyright (c) 2000, 2013, 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 it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation. Oracle designates this8* particular file as subject to the "Classpath" exception as provided9* 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 WITHOUT12* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or13* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License14* version 2 for more details (a copy is included in the LICENSE file that15* accompanied this code).16*17* You should have received a copy of the GNU General Public License version18* 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 USA22* or visit www.oracle.com if you need additional information or have any23* questions.24*/25package javax.print.attribute.standard;2627import javax.print.attribute.Attribute;28import javax.print.attribute.EnumSyntax;29import javax.print.attribute.DocAttribute;30import javax.print.attribute.PrintRequestAttribute;31import javax.print.attribute.PrintJobAttribute;3233/**34* Class Chromaticity is a printing attribute class, an enumeration, that35* specifies monochrome or color printing. This is used by a print client36* to specify how the print data should be generated or processed. It is not37* descriptive of the color capabilities of the device. Query the service's38* {@link ColorSupported ColorSupported} attribute to determine if the device39* can be verified to support color printing.40* <P>41* The table below shows the effects of specifying a Chromaticity attribute of42* {@link #MONOCHROME MONOCHROME} or {@link #COLOR COLOR}43* for a monochrome or color document.44* <P>45* <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes">46* <TR>47* <TH>48* Chromaticity<BR>Attribute49* </TH>50* <TH>51* Effect on<BR>Monochrome Document52* </TH>53* <TH>54* Effect on<BR>Color Document55* </TH>56* </TR>57* <TR>58* <TD>59* {@link #MONOCHROME MONOCHROME}60* </TD>61* <TD>62* Printed as is, in monochrome63* </TD>64* <TD>65* Printed in monochrome, with colors converted to shades of gray66* </TD>67* </TR>68* <TR>69* <TD>70* {@link #COLOR COLOR}71* </TD>72* <TD>73* Printed as is, in monochrome74* </TD>75* <TD>76* Printed as is, in color77* </TD>78* </TR>79* </TABLE>80* <P>81* <P>82* <B>IPP Compatibility:</B> Chromaticity is not an IPP attribute at present.83* <P>84*85* @author Alan Kaminsky86*/87public final class Chromaticity extends EnumSyntax88implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {8990private static final long serialVersionUID = 4660543931355214012L;9192/**93* Monochrome printing.94*/95public static final Chromaticity MONOCHROME = new Chromaticity(0);9697/**98* Color printing.99*/100public static final Chromaticity COLOR = new Chromaticity(1);101102103/**104* Construct a new chromaticity enumeration value with the given integer105* value.106*107* @param value Integer value.108*/109protected Chromaticity(int value) {110super(value);111}112113private static final String[] myStringTable = {"monochrome",114"color"};115116private static final Chromaticity[] myEnumValueTable = {MONOCHROME,117COLOR};118119/**120* Returns the string table for class Chromaticity.121*/122protected String[] getStringTable() {123return myStringTable;124}125126/**127* Returns the enumeration value table for class Chromaticity.128*/129protected EnumSyntax[] getEnumValueTable() {130return myEnumValueTable;131}132133/**134* Get the printing attribute class which is to be used as the "category"135* for this printing attribute value.136* <P>137* For class Chromaticity, the category is the class Chromaticity itself.138*139* @return Printing attribute class (category), an instance of class140* {@link java.lang.Class java.lang.Class}.141*/142public final Class<? extends Attribute> getCategory() {143return Chromaticity.class;144}145146/**147* Get the name of the category of which this attribute value is an148* instance.149* <P>150* For class Chromaticity, the category name is <CODE>"chromaticity"</CODE>.151*152* @return Attribute category name.153*/154public final String getName() {155return "chromaticity";156}157158}159160161