Path: blob/master/src/java.desktop/share/classes/javax/print/attribute/standard/MediaTray.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 MediaTray} is a subclass of {@code Media}. Class34* {@code MediaTray} is a printing attribute class, an enumeration, that35* specifies the media tray or bin for the job. This attribute can be used36* instead of specifying {@code MediaSize} or {@code MediaName}.37* <p>38* Class {@code MediaTray} declares keywords for standard media kind values.39* Implementation- or site-defined names for a media kind attribute may also be40* created by defining a subclass of class {@code MediaTray}.41* <p>42* <b>IPP Compatibility:</b> {@code MediaTray} is a representation class for43* values of the IPP "media" attribute which name paper trays.44*/45public class MediaTray extends Media implements Attribute {4647/**48* Use serialVersionUID from JDK 1.4 for interoperability.49*/50@Serial51private static final long serialVersionUID = -982503611095214703L;5253/**54* The top input tray in the printer.55*/56public static final MediaTray TOP = new MediaTray(0);5758/**59* The middle input tray in the printer.60*/61public static final MediaTray MIDDLE = new MediaTray(1);6263/**64* The bottom input tray in the printer.65*/66public static final MediaTray BOTTOM = new MediaTray(2);6768/**69* The envelope input tray in the printer.70*/71public static final MediaTray ENVELOPE = new MediaTray(3);7273/**74* The manual feed input tray in the printer.75*/76public static final MediaTray MANUAL = new MediaTray(4);7778/**79* The large capacity input tray in the printer.80*/81public static final MediaTray LARGE_CAPACITY = new MediaTray(5);8283/**84* The main input tray in the printer.85*/86public static final MediaTray MAIN = new MediaTray(6);8788/**89* The side input tray.90*/91public static final MediaTray SIDE = new MediaTray(7);9293/**94* Construct a new media tray enumeration value with the given integer95* value.96*97* @param value Integer value98*/99protected MediaTray(int value) {100super (value);101}102103/**104* The string table for class {@code MediaTray}.105*/106private static final String[] myStringTable ={107"top",108"middle",109"bottom",110"envelope",111"manual",112"large-capacity",113"main",114"side"115};116117/**118* The enumeration value table for class {@code MediaTray}.119*/120private static final MediaTray[] myEnumValueTable = {121TOP,122MIDDLE,123BOTTOM,124ENVELOPE,125MANUAL,126LARGE_CAPACITY,127MAIN,128SIDE129};130131/**132* Returns the string table for class {@code MediaTray}.133*/134protected String[] getStringTable()135{136return myStringTable.clone();137}138139/**140* Returns the enumeration value table for class {@code MediaTray}.141*/142protected EnumSyntax[] getEnumValueTable() {143return (EnumSyntax[])myEnumValueTable.clone();144}145}146147148