1. /*
  2. * @(#)MediaName.java 1.7 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 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. /**
  28. * white letter paper.
  29. */
  30. public static final MediaName NA_LETTER_WHITE = new MediaName(0);
  31. /**
  32. * letter transparency.
  33. */
  34. public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);
  35. /**
  36. * white A4 paper.
  37. */
  38. public static final MediaName ISO_A4_WHITE = new MediaName(2);
  39. /**
  40. * A4 transparency.
  41. */
  42. public static final MediaName ISO_A4_TRANSPARENT= new MediaName(3);
  43. /**
  44. * Constructs a new media name enumeration value with the given integer
  45. * value.
  46. *
  47. * @param value Integer value.
  48. */
  49. protected MediaName(int value) {
  50. super (value);
  51. }
  52. private static final String[] myStringTable = {
  53. "na-letter-white",
  54. "na-letter-transparent",
  55. "iso-a4-white",
  56. "iso-a4-transparent"
  57. };
  58. private static final MediaName[] myEnumValueTable = {
  59. NA_LETTER_WHITE,
  60. NA_LETTER_TRANSPARENT,
  61. ISO_A4_WHITE,
  62. ISO_A4_TRANSPARENT
  63. };
  64. /**
  65. * Returns the string table for class MediaTray.
  66. * @return the String table.
  67. */
  68. protected String[] getStringTable()
  69. {
  70. return (String[])myStringTable.clone();
  71. }
  72. /**
  73. * Returns the enumeration value table for class MediaTray.
  74. * @return the enumeration value table.
  75. */
  76. protected EnumSyntax[] getEnumValueTable() {
  77. return (EnumSyntax[])myEnumValueTable.clone();
  78. }
  79. }