Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/MediaName.java
41171 views
/*1* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.print.attribute.standard;2627import java.io.Serial;2829import javax.print.attribute.Attribute;30import javax.print.attribute.EnumSyntax;3132/**33* Class {@code MediaName} is a subclass of {@code Media}, a printing attribute34* class (an enumeration) that specifies the media for a print job as a name.35* <p>36* This attribute can be used instead of specifying {@code MediaSize} or37* {@code MediaTray}.38* <p>39* Class {@code MediaName} currently declares a few standard media names.40* Implementation- or site-defined names for a media name attribute may also be41* created by defining a subclass of class {@code MediaName}.42* <p>43* <b>IPP Compatibility:</b> {@code MediaName} is a representation class for44* values of the IPP "media" attribute which names media.45*/46public class MediaName extends Media implements Attribute {4748/**49* Use serialVersionUID from JDK 1.4 for interoperability.50*/51@Serial52private static final long serialVersionUID = 4653117714524155448L;5354/**55* white letter paper.56*/57public static final MediaName NA_LETTER_WHITE = new MediaName(0);5859/**60* letter transparency.61*/62public static final MediaName NA_LETTER_TRANSPARENT = new MediaName(1);6364/**65* white A4 paper.66*/67public static final MediaName ISO_A4_WHITE = new MediaName(2);6869/**70* A4 transparency.71*/72public static final MediaName ISO_A4_TRANSPARENT= new MediaName(3);7374/**75* Constructs a new media name enumeration value with the given integer76* value.77*78* @param value Integer value79*/80protected MediaName(int value) {81super (value);82}8384/**85* The string table for class {@code MediaTray}.86*/87private static final String[] myStringTable = {88"na-letter-white",89"na-letter-transparent",90"iso-a4-white",91"iso-a4-transparent"92};9394/**95* The enumeration value table for class {@code MediaTray}.96*/97private static final MediaName[] myEnumValueTable = {98NA_LETTER_WHITE,99NA_LETTER_TRANSPARENT,100ISO_A4_WHITE,101ISO_A4_TRANSPARENT102};103104/**105* Returns the string table for class {@code MediaTray}.106*107* @return the string table108*/109protected String[] getStringTable()110{111return myStringTable.clone();112}113114/**115* Returns the enumeration value table for class {@code MediaTray}.116*117* @return the enumeration value table118*/119protected EnumSyntax[] getEnumValueTable() {120return (EnumSyntax[])myEnumValueTable.clone();121}122}123124125