KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > print > attribute > standard > ColorSupported


1 /*
2  * @(#)ColorSupported.java 1.8 04/05/05
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.print.attribute.standard;
8
9 import javax.print.attribute.Attribute JavaDoc;
10 import javax.print.attribute.EnumSyntax JavaDoc;
11 import javax.print.attribute.PrintServiceAttribute JavaDoc;
12
13 /**
14  * Class ColorSupported is a printing attribute class, an enumeration, that
15  * identifies whether the device is capable of any type of color printing at
16  * all, including highlight color as well as full process color. All document
17  * instructions having to do with color are embedded within the print data (none
18  * are attributes attached to the job outside the print data).
19  * <P>
20  * Note: End users are able to determine the nature and details of the color
21  * support by querying the {@link PrinterMoreInfoManufacturer
22  * PrinterMoreInfoManufacturer} attribute.
23  * <P>
24  * Don't confuse the ColorSupported attribute with the {@link Chromaticity
25  * Chromaticity} attribute. {@link Chromaticity Chromaticity} is an attribute
26  * the client can specify for a job to tell the printer whether to print a
27  * document in monochrome or color, possibly causing the printer to print a
28  * color document in monochrome. ColorSupported is a printer description
29  * attribute that tells whether the printer can print in color regardless of how
30  * the client specifies to print any particular document.
31  * <P>
32  * <B>IPP Compatibility:</B> The IPP boolean value is "true" for SUPPORTED and
33  * "false" for NOT_SUPPORTED. The category name returned by
34  * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
35  * integer value is the IPP enum value. The <code>toString()</code> method
36  * returns the IPP string representation of the attribute value.
37  * <P>
38  *
39  * @author Alan Kaminsky
40  */

41 public final class ColorSupported extends EnumSyntax JavaDoc
42     implements PrintServiceAttribute JavaDoc {
43   
44     private static final long serialVersionUID = -2700555589688535545L;
45
46     /**
47      * The printer is not capable of any type of color printing.
48      */

49     public static final ColorSupported JavaDoc NOT_SUPPORTED = new ColorSupported JavaDoc(0);
50
51     /**
52      * The printer is capable of some type of color printing, such as
53      * highlight color or full process color.
54      */

55     public static final ColorSupported JavaDoc SUPPORTED = new ColorSupported JavaDoc(1);
56
57     /**
58      * Construct a new color supported enumeration value with the given
59      * integer value.
60      *
61      * @param value Integer value.
62      */

63     protected ColorSupported(int value) {
64     super (value);
65     }
66
67     private static final String JavaDoc[] myStringTable = {"not-supported",
68                            "supported"};
69
70     private static final ColorSupported JavaDoc[] myEnumValueTable = {NOT_SUPPORTED,
71                                   SUPPORTED};
72
73     /**
74      * Returns the string table for class ColorSupported.
75      */

76     protected String JavaDoc[] getStringTable() {
77     return myStringTable;
78     }
79
80     /**
81      * Returns the enumeration value table for class ColorSupported.
82      */

83     protected EnumSyntax JavaDoc[] getEnumValueTable() {
84     return myEnumValueTable;
85     }
86
87     /**
88      * Get the printing attribute class which is to be used as the "category"
89      * for this printing attribute value.
90      * <P>
91      * For class ColorSupported, the category is class ColorSupported itself.
92      *
93      * @return Printing attribute class (category), an instance of class
94      * {@link java.lang.Class java.lang.Class}.
95      */

96     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
97     return ColorSupported JavaDoc.class;
98     }
99
100     /**
101      * Get the name of the category of which this attribute value is an
102      * instance.
103      * <P>
104      * For class ColorSupported, the category name is <CODE>"color-supported"</CODE>.
105      *
106      * @return Attribute category name.
107      */

108     public final String JavaDoc getName() {
109     return "color-supported";
110     }
111     
112 }
113
Popular Tags