GNU Classpath (0.20) | |
Frames | No Frames |
1: /* PresentationDirection.java -- 2: Copyright (C) 2004, 2005 Free Software Foundation, Inc. 3: 4: This file is part of GNU Classpath. 5: 6: GNU Classpath is free software; you can redistribute it and/or modify 7: it under the terms of the GNU General Public License as published by 8: the Free Software Foundation; either version 2, or (at your option) 9: any later version. 10: 11: GNU Classpath is distributed in the hope that it will be useful, but 12: WITHOUT ANY WARRANTY; without even the implied warranty of 13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14: General Public License for more details. 15: 16: You should have received a copy of the GNU General Public License 17: along with GNU Classpath; see the file COPYING. If not, write to the 18: Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 19: 02110-1301 USA. 20: 21: Linking this library statically or dynamically with other modules is 22: making a combined work based on this library. Thus, the terms and 23: conditions of the GNU General Public License cover the whole 24: combination. 25: 26: As a special exception, the copyright holders of this library give you 27: permission to link this library with independent modules to produce an 28: executable, regardless of the license terms of these independent 29: modules, and to copy and distribute the resulting executable under 30: terms of your choice, provided that you also meet, for each linked 31: independent module, the terms and conditions of the license of that 32: module. An independent module is a module which is not derived from 33: or based on this library. If you modify this library, you may extend 34: this exception to your version of the library, but you are not 35: obligated to do so. If you do not wish to do so, delete this 36: exception statement from your version. */ 37: 38: package javax.print.attribute.standard; 39: 40: import javax.print.attribute.EnumSyntax; 41: import javax.print.attribute.PrintJobAttribute; 42: import javax.print.attribute.PrintRequestAttribute; 43: 44: 45: /** 46: * The <code>PresentationDirection</code> attribute specifies 47: * a value to be used together with the <code>NumberUp</code> attribute 48: * to indicate the layout of multiple pages on a single media sheet. 49: * <p> 50: * <b>IPP Compatibility:</b> PresentationDirection is not an IPP 1.1 51: * attribute. 52: * </p> 53: * 54: * @author Michael Koch (konqueror@gmx.de) 55: * @author Wolfgang Baer (WBaer@gmx.de) 56: */ 57: public final class PresentationDirection extends EnumSyntax 58: implements PrintRequestAttribute, PrintJobAttribute 59: { 60: private static final long serialVersionUID = 8294728067230931780L; 61: 62: /** 63: * The single pages are arranged on the media in columns starting 64: * at the top left towards the bottom left. 65: */ 66: public static final PresentationDirection TOBOTTOM_TORIGHT = 67: new PresentationDirection(0); 68: 69: /** 70: * The single pages are arranged on the media in columns starting 71: * at the top right towards the bottom left. 72: */ 73: public static final PresentationDirection TOBOTTOM_TOLEFT = 74: new PresentationDirection(1); 75: 76: /** 77: * The single pages are arranged on the media in columns starting 78: * at the bottom left towards the top right. 79: */ 80: public static final PresentationDirection TOTOP_TORIGHT = 81: new PresentationDirection(2); 82: 83: /** 84: * The single pages are arranged on the media in columns starting 85: * at the bottom right towards the top left. 86: */ 87: public static final PresentationDirection TOTOP_TOLEFT = 88: new PresentationDirection(3); 89: 90: /** 91: * The single pages are arranged on the media in rows starting 92: * at the top left towards the right bottom. 93: */ 94: public static final PresentationDirection TORIGHT_TOBOTTOM = 95: new PresentationDirection(4); 96: 97: /** 98: * The single pages are arranged on the media in rows starting 99: * at the bottom left towards the right top. 100: */ 101: public static final PresentationDirection TORIGHT_TOTOP = 102: new PresentationDirection(5); 103: 104: /** 105: * The single pages are arranged on the media in rows starting 106: * at the top right towards the left bottom. 107: */ 108: public static final PresentationDirection TOLEFT_TOBOTTOM = 109: new PresentationDirection(6); 110: 111: /** 112: * The single pages are arranged on the media in rows starting 113: * at the bottom right towards the left top. 114: */ 115: public static final PresentationDirection TOLEFT_TOTOP = 116: new PresentationDirection(7); 117: 118: private static final String[] stringTable = { "tobottom-toright", 119: "tobottom-toleft", "totop-toright", "totop-toleft", "toright-tobottom", 120: "toright-totop", "toleft-tobottom", "toleft-totop" }; 121: 122: private static final PresentationDirection[] enumValueTable = 123: { TOBOTTOM_TORIGHT, TOBOTTOM_TOLEFT, TOTOP_TORIGHT, TOTOP_TOLEFT, 124: TORIGHT_TOBOTTOM, TORIGHT_TOTOP, TOLEFT_TOBOTTOM, TOLEFT_TOTOP }; 125: 126: /** 127: * Constructs a <code>PresentationDirection</code> object. 128: * 129: * @param value the enum value. 130: */ 131: private PresentationDirection(int value) 132: { 133: super(value); 134: } 135: 136: /** 137: * Returns category of this class. 138: * 139: * @return The class <code>PresentationDirection</code> itself. 140: */ 141: public Class getCategory() 142: { 143: return PresentationDirection.class; 144: } 145: 146: /** 147: * Returns the name of this attribute. 148: * 149: * @return The name "presentation-direction". 150: */ 151: public String getName() 152: { 153: return "presentation-direction"; 154: } 155: 156: /** 157: * Returns a table with the enumeration values represented as strings 158: * for this object. 159: * 160: * @return The enumeration values as strings. 161: */ 162: protected String[] getStringTable() 163: { 164: return stringTable; 165: } 166: 167: /** 168: * Returns a table with the enumeration values for this object. 169: * 170: * @return The enumeration values. 171: */ 172: protected EnumSyntax[] getEnumValueTable() 173: { 174: return enumValueTable; 175: } 176: }
GNU Classpath (0.20) |