001 /* PresentationDirection.java -- 002 Copyright (C) 2004, 2005 Free Software Foundation, Inc. 003 004 This file is part of GNU Classpath. 005 006 GNU Classpath is free software; you can redistribute it and/or modify 007 it under the terms of the GNU General Public License as published by 008 the Free Software Foundation; either version 2, or (at your option) 009 any later version. 010 011 GNU Classpath is distributed in the hope that it will be useful, but 012 WITHOUT ANY WARRANTY; without even the implied warranty of 013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 014 General Public License for more details. 015 016 You should have received a copy of the GNU General Public License 017 along with GNU Classpath; see the file COPYING. If not, write to the 018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 019 02110-1301 USA. 020 021 Linking this library statically or dynamically with other modules is 022 making a combined work based on this library. Thus, the terms and 023 conditions of the GNU General Public License cover the whole 024 combination. 025 026 As a special exception, the copyright holders of this library give you 027 permission to link this library with independent modules to produce an 028 executable, regardless of the license terms of these independent 029 modules, and to copy and distribute the resulting executable under 030 terms of your choice, provided that you also meet, for each linked 031 independent module, the terms and conditions of the license of that 032 module. An independent module is a module which is not derived from 033 or based on this library. If you modify this library, you may extend 034 this exception to your version of the library, but you are not 035 obligated to do so. If you do not wish to do so, delete this 036 exception statement from your version. */ 037 038 package javax.print.attribute.standard; 039 040 import javax.print.attribute.Attribute; 041 import javax.print.attribute.EnumSyntax; 042 import javax.print.attribute.PrintJobAttribute; 043 import javax.print.attribute.PrintRequestAttribute; 044 045 046 /** 047 * The <code>PresentationDirection</code> attribute specifies 048 * a value to be used together with the <code>NumberUp</code> attribute 049 * to indicate the layout of multiple pages on a single media sheet. 050 * <p> 051 * <b>IPP Compatibility:</b> PresentationDirection is not an IPP 1.1 052 * attribute. 053 * </p> 054 * 055 * @author Michael Koch (konqueror@gmx.de) 056 * @author Wolfgang Baer (WBaer@gmx.de) 057 */ 058 public final class PresentationDirection extends EnumSyntax 059 implements PrintRequestAttribute, PrintJobAttribute 060 { 061 private static final long serialVersionUID = 8294728067230931780L; 062 063 /** 064 * The single pages are arranged on the media in columns starting 065 * at the top left towards the bottom left. 066 */ 067 public static final PresentationDirection TOBOTTOM_TORIGHT = 068 new PresentationDirection(0); 069 070 /** 071 * The single pages are arranged on the media in columns starting 072 * at the top right towards the bottom left. 073 */ 074 public static final PresentationDirection TOBOTTOM_TOLEFT = 075 new PresentationDirection(1); 076 077 /** 078 * The single pages are arranged on the media in columns starting 079 * at the bottom left towards the top right. 080 */ 081 public static final PresentationDirection TOTOP_TORIGHT = 082 new PresentationDirection(2); 083 084 /** 085 * The single pages are arranged on the media in columns starting 086 * at the bottom right towards the top left. 087 */ 088 public static final PresentationDirection TOTOP_TOLEFT = 089 new PresentationDirection(3); 090 091 /** 092 * The single pages are arranged on the media in rows starting 093 * at the top left towards the right bottom. 094 */ 095 public static final PresentationDirection TORIGHT_TOBOTTOM = 096 new PresentationDirection(4); 097 098 /** 099 * The single pages are arranged on the media in rows starting 100 * at the bottom left towards the right top. 101 */ 102 public static final PresentationDirection TORIGHT_TOTOP = 103 new PresentationDirection(5); 104 105 /** 106 * The single pages are arranged on the media in rows starting 107 * at the top right towards the left bottom. 108 */ 109 public static final PresentationDirection TOLEFT_TOBOTTOM = 110 new PresentationDirection(6); 111 112 /** 113 * The single pages are arranged on the media in rows starting 114 * at the bottom right towards the left top. 115 */ 116 public static final PresentationDirection TOLEFT_TOTOP = 117 new PresentationDirection(7); 118 119 private static final String[] stringTable = { "tobottom-toright", 120 "tobottom-toleft", "totop-toright", "totop-toleft", "toright-tobottom", 121 "toright-totop", "toleft-tobottom", "toleft-totop" }; 122 123 private static final PresentationDirection[] enumValueTable = 124 { TOBOTTOM_TORIGHT, TOBOTTOM_TOLEFT, TOTOP_TORIGHT, TOTOP_TOLEFT, 125 TORIGHT_TOBOTTOM, TORIGHT_TOTOP, TOLEFT_TOBOTTOM, TOLEFT_TOTOP }; 126 127 /** 128 * Constructs a <code>PresentationDirection</code> object. 129 * 130 * @param value the enum value. 131 */ 132 private PresentationDirection(int value) 133 { 134 super(value); 135 } 136 137 /** 138 * Returns category of this class. 139 * 140 * @return The class <code>PresentationDirection</code> itself. 141 */ 142 public Class< ? extends Attribute> getCategory() 143 { 144 return PresentationDirection.class; 145 } 146 147 /** 148 * Returns the name of this attribute. 149 * 150 * @return The name "presentation-direction". 151 */ 152 public String getName() 153 { 154 return "presentation-direction"; 155 } 156 157 /** 158 * Returns a table with the enumeration values represented as strings 159 * for this object. 160 * 161 * @return The enumeration values as strings. 162 */ 163 protected String[] getStringTable() 164 { 165 return stringTable; 166 } 167 168 /** 169 * Returns a table with the enumeration values for this object. 170 * 171 * @return The enumeration values. 172 */ 173 protected EnumSyntax[] getEnumValueTable() 174 { 175 return enumValueTable; 176 } 177 }