KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)PrintQuality.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.DocAttribute JavaDoc;
12 import javax.print.attribute.PrintRequestAttribute JavaDoc;
13 import javax.print.attribute.PrintJobAttribute JavaDoc;
14
15 /**
16  * Class PrintQuality is a printing attribute class, an enumeration,
17  * that specifies the print quality that the printer uses for the job.
18  * <P>
19  * <B>IPP Compatibility:</B> The category name returned by
20  * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
21  * integer value is the IPP enum value. The <code>toString()</code> method
22  * returns the IPP string representation of the attribute value.
23  * <P>
24  *
25  * @author David Mendenhall
26  * @author Alan Kaminsky
27  */

28 public class PrintQuality extends EnumSyntax JavaDoc
29     implements DocAttribute JavaDoc, PrintRequestAttribute JavaDoc, PrintJobAttribute JavaDoc {
30
31     private static final long serialVersionUID = -3072341285225858365L;
32     /**
33      * Lowest quality available on the printer.
34      */

35     public static final PrintQuality JavaDoc DRAFT = new PrintQuality JavaDoc(3);
36
37     /**
38      * Normal or intermediate quality on the printer.
39      */

40     public static final PrintQuality JavaDoc NORMAL = new PrintQuality JavaDoc(4);
41
42     /**
43      * Highest quality available on the printer.
44      */

45     public static final PrintQuality JavaDoc HIGH = new PrintQuality JavaDoc(5);
46
47     /**
48      * Construct a new print quality enumeration value with the given integer
49      * value.
50      *
51      * @param value Integer value.
52      */

53     protected PrintQuality(int value) {
54     super (value);
55     }
56
57     private static final String JavaDoc[] myStringTable = {
58     "draft",
59     "normal",
60     "high"
61     };
62
63     private static final PrintQuality JavaDoc[] myEnumValueTable = {
64     DRAFT,
65     NORMAL,
66     HIGH
67     };
68
69     /**
70      * Returns the string table for class PrintQuality.
71      */

72     protected String JavaDoc[] getStringTable() {
73     return (String JavaDoc[])myStringTable.clone();
74     }
75
76     /**
77      * Returns the enumeration value table for class PrintQuality.
78      */

79     protected EnumSyntax JavaDoc[] getEnumValueTable() {
80     return (EnumSyntax JavaDoc[])myEnumValueTable.clone();
81     }
82
83     /**
84      * Returns the lowest integer value used by class PrintQuality.
85      */

86     protected int getOffset() {
87     return 3;
88     }
89
90     /**
91      * Get the printing attribute class which is to be used as the "category"
92      * for this printing attribute value.
93      * <P>
94      * For class PrintQuality and any vendor-defined subclasses, the category is
95      * class PrintQuality itself.
96      *
97      * @return Printing attribute class (category), an instance of class
98      * {@link java.lang.Class java.lang.Class}.
99      */

100     public final Class JavaDoc<? extends Attribute JavaDoc> getCategory() {
101     return PrintQuality JavaDoc.class;
102     }
103
104     /**
105      * Get the name of the category of which this attribute value is an
106      * instance.
107      * <P>
108      * For class PrintQuality and any vendor-defined subclasses, the category
109      * name is <CODE>"print-quality"</CODE>.
110      *
111      * @return Attribute category name.
112      */

113     public final String JavaDoc getName() {
114     return "print-quality";
115     }
116
117 }
118
Popular Tags