001/* Chromaticity.java -- 002 Copyright (C) 2005 Free Software Foundation, Inc. 003 004This file is part of GNU Classpath. 005 006GNU Classpath is free software; you can redistribute it and/or modify 007it under the terms of the GNU General Public License as published by 008the Free Software Foundation; either version 2, or (at your option) 009any later version. 010 011GNU Classpath is distributed in the hope that it will be useful, but 012WITHOUT ANY WARRANTY; without even the implied warranty of 013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014General Public License for more details. 015 016You should have received a copy of the GNU General Public License 017along with GNU Classpath; see the file COPYING. If not, write to the 018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 01902110-1301 USA. 020 021Linking this library statically or dynamically with other modules is 022making a combined work based on this library. Thus, the terms and 023conditions of the GNU General Public License cover the whole 024combination. 025 026As a special exception, the copyright holders of this library give you 027permission to link this library with independent modules to produce an 028executable, regardless of the license terms of these independent 029modules, and to copy and distribute the resulting executable under 030terms of your choice, provided that you also meet, for each linked 031independent module, the terms and conditions of the license of that 032module. An independent module is a module which is not derived from 033or based on this library. If you modify this library, you may extend 034this exception to your version of the library, but you are not 035obligated to do so. If you do not wish to do so, delete this 036exception statement from your version. */ 037 038 039package javax.print.attribute.standard; 040 041import javax.print.attribute.Attribute; 042import javax.print.attribute.DocAttribute; 043import javax.print.attribute.EnumSyntax; 044import javax.print.attribute.PrintJobAttribute; 045import javax.print.attribute.PrintRequestAttribute; 046 047/** 048 * The <code>Chromaticity</code> printing attribute specifies if print data 049 * should be printed in monochrome or color. 050 * <p> 051 * The attribute interacts with the document to be printed. If the document 052 * to be printed is a monochrome document it will be printed monochrome 053 * regardless of the value of this attribute category. However if it is a 054 * color document supplying the attribute value <code>MONOCHROME</code> 055 * will prepare the document to be printed in monochrome instead of color. 056 * </p> 057 * <p> 058 * This printing attribute has nothing to do with the capabilities of the 059 * printer device. To check if a specific printer service supports printing 060 * in color you have to use the attribute 061 * {@link javax.print.attribute.standard.ColorSupported} 062 * </p> 063 * <p> 064 * <b>IPP Compatibility:</b> Chromaticity is not an IPP 1.1 attribute. 065 * </p> 066 * 067 * @author Michael Koch (konqueror@gmx.de) 068 */ 069public final class Chromaticity extends EnumSyntax 070 implements DocAttribute, PrintRequestAttribute, PrintJobAttribute 071{ 072 private static final long serialVersionUID = 4660543931355214012L; 073 074 /** Specifies monochrome printing. */ 075 public static final Chromaticity MONOCHROME = new Chromaticity(0); 076 077 /** Specifies color printing. */ 078 public static final Chromaticity COLOR = new Chromaticity(1); 079 080 private static final String[] stringTable = { "monochrome", "color" }; 081 private static final Chromaticity[] enumValueTable = { MONOCHROME, COLOR }; 082 083 /** 084 * Creates a <code>Chromaticity</code> object. 085 * 086 * @param value the enum value 087 */ 088 protected Chromaticity(int value) 089 { 090 super(value); 091 } 092 093 /** 094 * Returns category of this class. 095 * 096 * @return The class <code>Chromaticity</code> itself. 097 */ 098 public Class< ? extends Attribute> getCategory() 099 { 100 return Chromaticity.class; 101 } 102 103 /** 104 * Returns the name of this attribute. 105 * 106 * @return The name "chromaticity". 107 */ 108 public String getName() 109 { 110 return "chromaticity"; 111 } 112 113 /** 114 * Returns a table with the enumeration values represented as strings 115 * for this object. 116 * 117 * @return The enumeration values as strings. 118 */ 119 protected String[] getStringTable() 120 { 121 return stringTable; 122 } 123 124 /** 125 * Returns a table with the enumeration values for this object. 126 * 127 * @return The enumeration values. 128 */ 129 protected EnumSyntax[] getEnumValueTable() 130 { 131 return enumValueTable; 132 } 133 134}