1. /*
  2. * @(#)MediaTray.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 java.util.Locale;
  9. import javax.print.attribute.Attribute;
  10. import javax.print.attribute.EnumSyntax;
  11. /**
  12. * Class MediaTray is a subclass of Media.
  13. * Class MediaTray is a printing attribute class, an enumeration, that
  14. * specifies the media tray or bin for the job.
  15. * This attribute can be used instead of specifying MediaSize or MediaName.
  16. * <p>
  17. * Class MediaTray declares keywords for standard media kind values.
  18. * Implementation- or site-defined names for a media kind attribute may also
  19. * be created by defining a subclass of class MediaTray.
  20. * <P>
  21. * <B>IPP Compatibility:</B> MediaTray is a representation class for
  22. * values of the IPP "media" attribute which name paper trays.
  23. * <P>
  24. *
  25. */
  26. public class MediaTray extends Media implements Attribute {
  27. /**
  28. * The top input tray in the printer.
  29. */
  30. public static final MediaTray TOP = new MediaTray(0);
  31. /**
  32. * The middle input tray in the printe.
  33. */
  34. public static final MediaTray MIDDLE = new MediaTray(1);
  35. /**
  36. * The bottom input tray in the printer.
  37. */
  38. public static final MediaTray BOTTOM = new MediaTray(2);
  39. /**
  40. * The envelope input tray in the printer.
  41. */
  42. public static final MediaTray ENVELOPE = new MediaTray(3);
  43. /**
  44. * The manual feed input tray in the printer.
  45. */
  46. public static final MediaTray MANUAL = new MediaTray(4);
  47. /**
  48. * The large capacity input tray in the printer.
  49. */
  50. public static final MediaTray LARGE_CAPACITY = new MediaTray(5);
  51. /**
  52. * The main input tray in the printer.
  53. */
  54. public static final MediaTray MAIN = new MediaTray(6);
  55. /**
  56. * The side input tray.
  57. */
  58. public static final MediaTray SIDE = new MediaTray(7);
  59. /**
  60. * Construct a new media tray enumeration value with the given integer
  61. * value.
  62. *
  63. * @param value Integer value.
  64. */
  65. protected MediaTray(int value) {
  66. super (value);
  67. }
  68. private static final String[] myStringTable ={
  69. "top",
  70. "middle",
  71. "bottom",
  72. "envelope",
  73. "manual",
  74. "large-capacity",
  75. "main",
  76. "side"
  77. };
  78. private static final MediaTray[] myEnumValueTable = {
  79. TOP,
  80. MIDDLE,
  81. BOTTOM,
  82. ENVELOPE,
  83. MANUAL,
  84. LARGE_CAPACITY,
  85. MAIN,
  86. SIDE
  87. };
  88. /**
  89. * Returns the string table for class MediaTray.
  90. */
  91. protected String[] getStringTable()
  92. {
  93. return (String[])myStringTable.clone();
  94. }
  95. /**
  96. * Returns the enumeration value table for class MediaTray.
  97. */
  98. protected EnumSyntax[] getEnumValueTable() {
  99. return (EnumSyntax[])myEnumValueTable.clone();
  100. }
  101. }