1. /*
  2. * @(#)Chromaticity.java 1.6 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.DocAttribute;
  10. import javax.print.attribute.PrintRequestAttribute;
  11. import javax.print.attribute.PrintJobAttribute;
  12. /**
  13. * Class Chromaticity is a printing attribute class, an enumeration, that
  14. * specifies monochrome or color printing. This is used by a print client
  15. * to specify how the print data should be generated or processed. It is not
  16. * descriptive of the color capabilities of the device. Query the service's
  17. * {@link ColorSupported ColorSupported} attribute to determine if the device
  18. * can be verified to support color printing.
  19. * <P>
  20. * The table below shows the effects of specifying a Chromaticity attribute of
  21. * {@link #MONOCHROME <CODE>MONOCHROME</CODE>} or {@link #COLOR
  22. * <CODE>COLOR</CODE>} for a monochrome or color document.
  23. * <P>
  24. * <TABLE BORDER=1 CELLPADDING=2 CELLSPACING=1 SUMMARY="Shows effects of specifying MONOCHROME or COLOR Chromaticity attributes">
  25. * <TR BGCOLOR="#E5E5E5">
  26. * <TH>
  27. * Chromaticity<BR>Attribute
  28. * </TH>
  29. * <TH>
  30. * Effect on<BR>Monochrome Document
  31. * </TH>
  32. * <TH>
  33. * Effect on<BR>Color Document
  34. * </TH>
  35. * </TR>
  36. * <TR>
  37. * <TD>
  38. * {@link #MONOCHROME <CODE>MONOCHROME</CODE>}
  39. * </TD>
  40. * <TD>
  41. * Printed as is, in monochrome
  42. * </TD>
  43. * <TD>
  44. * Printed in monochrome, with colors converted to shades of gray
  45. * </TD>
  46. * </TR>
  47. * <TR>
  48. * <TD>
  49. * {@link #COLOR <CODE>COLOR</CODE>}
  50. * </TD>
  51. * <TD>
  52. * Printed as is, in monochrome
  53. * </TD>
  54. * <TD>
  55. * Printed as is, in color
  56. * </TD>
  57. * </TR>
  58. * </TABLE>
  59. * <P>
  60. * <P>
  61. * <B>IPP Compatibility:</B> Chromaticity is not an IPP attribute at present.
  62. * <P>
  63. *
  64. * @author Alan Kaminsky
  65. */
  66. public final class Chromaticity extends EnumSyntax
  67. implements DocAttribute, PrintRequestAttribute, PrintJobAttribute {
  68. /**
  69. * Monochrome printing.
  70. */
  71. public static final Chromaticity MONOCHROME = new Chromaticity(0);
  72. /**
  73. * Color printing.
  74. */
  75. public static final Chromaticity COLOR = new Chromaticity(1);
  76. /**
  77. * Construct a new chromaticity enumeration value with the given integer
  78. * value.
  79. *
  80. * @param value Integer value.
  81. */
  82. protected Chromaticity(int value) {
  83. super(value);
  84. }
  85. private static final String[] myStringTable = {"monochrome",
  86. "color"};
  87. private static final Chromaticity[] myEnumValueTable = {MONOCHROME,
  88. COLOR};
  89. /**
  90. * Returns the string table for class Chromaticity.
  91. */
  92. protected String[] getStringTable() {
  93. return myStringTable;
  94. }
  95. /**
  96. * Returns the enumeration value table for class Chromaticity.
  97. */
  98. protected EnumSyntax[] getEnumValueTable() {
  99. return myEnumValueTable;
  100. }
  101. /**
  102. * Get the printing attribute class which is to be used as the "category"
  103. * for this printing attribute value.
  104. * <P>
  105. * For class Chromaticity, the category is the class Chromaticity itself.
  106. *
  107. * @return Printing attribute class (category), an instance of class
  108. * {@link java.lang.Class java.lang.Class}.
  109. */
  110. public final Class getCategory() {
  111. return Chromaticity.class;
  112. }
  113. /**
  114. * Get the name of the category of which this attribute value is an
  115. * instance.
  116. * <P>
  117. * For class Chromaticity, the category name is <CODE>"chromaticity"</CODE>.
  118. *
  119. * @return Attribute category name.
  120. */
  121. public final String getName() {
  122. return "chromaticity";
  123. }
  124. }