1. /*
  2. * @(#)MediaName.java 1.9 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 MediaName is a subclass of Media, a printing attribute class (an
  13. * enumeration) that specifies the media for a print job as a name.
  14. * <P>
  15. * This attribute can be used instead of specifying MediaSize or MediaTray.
  16. * <p>
  17. * Class MediaName currently declares a few standard media names.
  18. * Implementation- or site-defined names for a media name attribute may also
  19. * be created by defining a subclass of class MediaName.
  20. * <P>
  21. * <B>IPP Compatibility:</B> MediaName is a representation class for
  22. * values of the IPP "media" attribute which names media.
  23. * <P>
  24. *
  25. */
  26. public class MediaName extends Media implements Attribute {
  27. private static final long serialVersionUID = 4653117714524155448L;
  28. /**
  29. * white letter paper.
  30. */
  31. public static final MediaName NA_LETTER_WHITE = new MediaName(0);
  32. /**
  33. * letter transparency.
  34. */
  35. public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);
  36. /**
  37. * white A4 paper.
  38. */
  39. public static final MediaName ISO_A4_WHITE = new MediaName(2);
  40. /**
  41. * A4 transparency.
  42. */
  43. public static final MediaName ISO_A4_TRANSPARENT= new MediaName(3);
  44. /**
  45. * Constructs a new media name enumeration value with the given integer
  46. * value.
  47. *
  48. * @param value Integer value.
  49. */
  50. protected MediaName(int value) {
  51. super (value);
  52. }
  53. private static final String[] myStringTable = {
  54. "na-letter-white",
  55. "na-letter-transparent",
  56. "iso-a4-white",
  57. "iso-a4-transparent"
  58. };
  59. private static final MediaName[] myEnumValueTable = {
  60. NA_LETTER_WHITE,
  61. NA_LETTER_TRANSPARENT,
  62. ISO_A4_WHITE,
  63. ISO_A4_TRANSPARENT
  64. };
  65. /**
  66. * Returns the string table for class MediaTray.
  67. * @return the String table.
  68. */
  69. protected String[] getStringTable()
  70. {
  71. return (String[])myStringTable.clone();
  72. }
  73. /**
  74. * Returns the enumeration value table for class MediaTray.
  75. * @return the enumeration value table.
  76. */
  77. protected EnumSyntax[] getEnumValueTable() {
  78. return (EnumSyntax[])myEnumValueTable.clone();
  79. }
  80. }