001 /* Chromaticity.java -- 002 Copyright (C) 2005 Free Software Foundation, Inc. 003 004 This file is part of GNU Classpath. 005 006 GNU Classpath is free software; you can redistribute it and/or modify 007 it under the terms of the GNU General Public License as published by 008 the Free Software Foundation; either version 2, or (at your option) 009 any later version. 010 011 GNU Classpath is distributed in the hope that it will be useful, but 012 WITHOUT ANY WARRANTY; without even the implied warranty of 013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 General Public License for more details. 015 016 You should have received a copy of the GNU General Public License 017 along with GNU Classpath; see the file COPYING. If not, write to the 018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 019 02110-1301 USA. 020 021 Linking this library statically or dynamically with other modules is 022 making a combined work based on this library. Thus, the terms and 023 conditions of the GNU General Public License cover the whole 024 combination. 025 026 As a special exception, the copyright holders of this library give you 027 permission to link this library with independent modules to produce an 028 executable, regardless of the license terms of these independent 029 modules, and to copy and distribute the resulting executable under 030 terms of your choice, provided that you also meet, for each linked 031 independent module, the terms and conditions of the license of that 032 module. An independent module is a module which is not derived from 033 or based on this library. If you modify this library, you may extend 034 this exception to your version of the library, but you are not 035 obligated to do so. If you do not wish to do so, delete this 036 exception statement from your version. */ 037 038 039 package javax.print.attribute.standard; 040 041 import javax.print.attribute.Attribute; 042 import javax.print.attribute.DocAttribute; 043 import javax.print.attribute.EnumSyntax; 044 import javax.print.attribute.PrintJobAttribute; 045 import 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 */ 069 public 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 }