1. /*
  2. * @(#)MediaTray.java 1.8 03/12/19
  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 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. private static final long serialVersionUID = -982503611095214703L;
  28. /**
  29. * The top input tray in the printer.
  30. */
  31. public static final MediaTray TOP = new MediaTray(0);
  32. /**
  33. * The middle input tray in the printe.
  34. */
  35. public static final MediaTray MIDDLE = new MediaTray(1);
  36. /**
  37. * The bottom input tray in the printer.
  38. */
  39. public static final MediaTray BOTTOM = new MediaTray(2);
  40. /**
  41. * The envelope input tray in the printer.
  42. */
  43. public static final MediaTray ENVELOPE = new MediaTray(3);
  44. /**
  45. * The manual feed input tray in the printer.
  46. */
  47. public static final MediaTray MANUAL = new MediaTray(4);
  48. /**
  49. * The large capacity input tray in the printer.
  50. */
  51. public static final MediaTray LARGE_CAPACITY = new MediaTray(5);
  52. /**
  53. * The main input tray in the printer.
  54. */
  55. public static final MediaTray MAIN = new MediaTray(6);
  56. /**
  57. * The side input tray.
  58. */
  59. public static final MediaTray SIDE = new MediaTray(7);
  60. /**
  61. * Construct a new media tray enumeration value with the given integer
  62. * value.
  63. *
  64. * @param value Integer value.
  65. */
  66. protected MediaTray(int value) {
  67. super (value);
  68. }
  69. private static final String[] myStringTable ={
  70. "top",
  71. "middle",
  72. "bottom",
  73. "envelope",
  74. "manual",
  75. "large-capacity",
  76. "main",
  77. "side"
  78. };
  79. private static final MediaTray[] myEnumValueTable = {
  80. TOP,
  81. MIDDLE,
  82. BOTTOM,
  83. ENVELOPE,
  84. MANUAL,
  85. LARGE_CAPACITY,
  86. MAIN,
  87. SIDE
  88. };
  89. /**
  90. * Returns the string table for class MediaTray.
  91. */
  92. protected String[] getStringTable()
  93. {
  94. return (String[])myStringTable.clone();
  95. }
  96. /**
  97. * Returns the enumeration value table for class MediaTray.
  98. */
  99. protected EnumSyntax[] getEnumValueTable() {
  100. return (EnumSyntax[])myEnumValueTable.clone();
  101. }
  102. }