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