1. /*
  2. * @(#)ColorSupported.java 1.5 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.print.attribute.standard;
  8. import javax.print.attribute.EnumSyntax;
  9. import javax.print.attribute.PrintServiceAttribute;
  10. /**
  11. * Class ColorSupported is a printing attribute class, an enumeration, that
  12. * identifies whether the device is capable of any type of color printing at
  13. * all, including highlight color as well as full process color. All document
  14. * instructions having to do with color are embedded within the print data (none
  15. * are attributes attached to the job outside the print data).
  16. * <P>
  17. * Note: End users are able to determine the nature and details of the color
  18. * support by querying the {@link PrinterMoreInfoManufacturer
  19. * PrinterMoreInfoManufacturer} attribute.
  20. * <P>
  21. * Don't confuse the ColorSupported attribute with the {@link Chromaticity
  22. * Chromaticity} attribute. {@link Chromaticity Chromaticity} is an attribute
  23. * the client can specify for a job to tell the printer whether to print a
  24. * document in monochrome or color, possibly causing the printer to print a
  25. * color document in monochrome. ColorSupported is a printer description
  26. * attribute that tells whether the printer can print in color regardless of how
  27. * the client specifies to print any particular document.
  28. * <P>
  29. * <B>IPP Compatibility:</B> The IPP boolean value is "true" for SUPPORTED and
  30. * "false" for NOT_SUPPORTED. The category name returned by
  31. * <CODE>getName()</CODE> is the IPP attribute name. The enumeration's
  32. * integer value is the IPP enum value. The <code>toString()</code> method
  33. * returns the IPP string representation of the attribute value.
  34. * <P>
  35. *
  36. * @author Alan Kaminsky
  37. */
  38. public final class ColorSupported extends EnumSyntax
  39. implements PrintServiceAttribute {
  40. /**
  41. * The printer is not capable of any type of color printing.
  42. */
  43. public static final ColorSupported NOT_SUPPORTED = new ColorSupported(0);
  44. /**
  45. * The printer is capable of some type of color printing, such as
  46. * highlight color or full process color.
  47. */
  48. public static final ColorSupported SUPPORTED = new ColorSupported(1);
  49. /**
  50. * Construct a new color supported enumeration value with the given
  51. * integer value.
  52. *
  53. * @param value Integer value.
  54. */
  55. protected ColorSupported(int value) {
  56. super (value);
  57. }
  58. private static final String[] myStringTable = {"not-supported",
  59. "supported"};
  60. private static final ColorSupported[] myEnumValueTable = {NOT_SUPPORTED,
  61. SUPPORTED};
  62. /**
  63. * Returns the string table for class ColorSupported.
  64. */
  65. protected String[] getStringTable() {
  66. return myStringTable;
  67. }
  68. /**
  69. * Returns the enumeration value table for class ColorSupported.
  70. */
  71. protected EnumSyntax[] getEnumValueTable() {
  72. return myEnumValueTable;
  73. }
  74. /**
  75. * Get the printing attribute class which is to be used as the "category"
  76. * for this printing attribute value.
  77. * <P>
  78. * For class ColorSupported, the category is class ColorSupported itself.
  79. *
  80. * @return Printing attribute class (category), an instance of class
  81. * {@link java.lang.Class java.lang.Class}.
  82. */
  83. public final Class getCategory() {
  84. return ColorSupported.class;
  85. }
  86. /**
  87. * Get the name of the category of which this attribute value is an
  88. * instance.
  89. * <P>
  90. * For class ColorSupported, the category name is <CODE>"color-supported"</CODE>.
  91. *
  92. * @return Attribute category name.
  93. */
  94. public final String getName() {
  95. return "color-supported";
  96. }
  97. }