Source for gnu.javax.print.ipp.attribute.defaults.FinishingsDefault

   1: /* FinishingsDefault.java --
   2:    Copyright (C) 2006 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: 
  39: package gnu.javax.print.ipp.attribute.defaults;
  40: 
  41: import gnu.javax.print.ipp.IppUtilities;
  42: import gnu.javax.print.ipp.attribute.DefaultValueAttribute;
  43: 
  44: import javax.print.attribute.Attribute;
  45: import javax.print.attribute.EnumSyntax;
  46: 
  47: 
  48: /**
  49:  * The <code>FinishingsDefault</code> attribute provides the supported
  50:  * values for finishings of a job.
  51:  *
  52:  * @author Wolfgang Baer (WBaer@gmx.de)
  53:  */
  54: public final class FinishingsDefault extends EnumSyntax
  55:   implements DefaultValueAttribute
  56: {
  57: 
  58:   /** No finishing. */
  59:   public static final FinishingsDefault NONE = new FinishingsDefault(3);
  60: 
  61:   /** Staple the document(s) */
  62:   public static final FinishingsDefault STAPLE = new FinishingsDefault(4);
  63: 
  64:   /** Cover a document */
  65:   public static final FinishingsDefault COVER = new FinishingsDefault(6);
  66: 
  67:   /**
  68:    * This value indicates that a binding is to be applied to the document.
  69:    * The type and placement of the binding is site-defined.
  70:    */
  71:   public static final FinishingsDefault BIND = new FinishingsDefault(7);
  72: 
  73:   /**
  74:    * Bind the document(s) with one or more staples (wire stitches)
  75:    * along the middle fold.
  76:    */
  77:   public static final FinishingsDefault SADDLE_STITCH = new FinishingsDefault(8);
  78: 
  79:   /**
  80:    * Bind the document(s) with one or more staples (wire stitches)
  81:    * along one edge.
  82:    */
  83:   public static final FinishingsDefault EDGE_STITCH = new FinishingsDefault(9);
  84: 
  85:   /**
  86:    * Bind the document(s) with one or more staples in the top left
  87:    * corner.
  88:    */
  89:   public static final FinishingsDefault STAPLE_TOP_LEFT = new FinishingsDefault(20);
  90: 
  91:   /**
  92:    * Bind the document(s) with one or more staples in the bottom
  93:    * left corner.
  94:    */
  95:   public static final FinishingsDefault STAPLE_BOTTOM_LEFT = new FinishingsDefault(21);
  96: 
  97:   /**
  98:    * Bind the document(s) with one or more staples in the top right corner.
  99:    */
 100:   public static final FinishingsDefault STAPLE_TOP_RIGHT = new FinishingsDefault(22);
 101: 
 102:   /**
 103:    * Bind the document(s) with one or more staples in the bottom right corner.
 104:    */
 105:   public static final FinishingsDefault STAPLE_BOTTOM_RIGHT = new FinishingsDefault(23);
 106: 
 107:   /**
 108:    * Bind the document(s) with one or more  staples (wire stitches)
 109:    * along the left edge.
 110:    */
 111:   public static final FinishingsDefault EDGE_STITCH_LEFT = new FinishingsDefault(24);
 112: 
 113:   /**
 114:    * Bind the document(s) with one or more staples (wire stitches) along
 115:    * the top edge.
 116:    */
 117:   public static final FinishingsDefault EDGE_STITCH_TOP = new FinishingsDefault(25);
 118: 
 119:   /**
 120:    * Bind the document(s) with one or more staples (wire stitches) along
 121:    * the right edge.
 122:    */
 123:   public static final FinishingsDefault EDGE_STITCH_RIGHT = new FinishingsDefault(26);
 124: 
 125:   /**
 126:    * Bind the document(s) with one or more staples (wire stitches) along
 127:    * the bottom edge.
 128:    */
 129:   public static final FinishingsDefault EDGE_STITCH_BOTTOM = new FinishingsDefault(27);
 130: 
 131:   /**
 132:    * Bind the document(s) with two staples (wire stitches) along the
 133:    * left edge assuming a portrait document.
 134:    */
 135:   public static final FinishingsDefault STAPLE_DUAL_LEFT = new FinishingsDefault(28);
 136: 
 137:   /**
 138:    * Bind the document(s) with two staples (wire stitches) along the
 139:    * top edge assuming a portrait document.
 140:    */
 141:   public static final FinishingsDefault STAPLE_DUAL_TOP = new FinishingsDefault(29);
 142: 
 143:   /**
 144:    * Bind the document(s) with two staples (wire stitches) along the
 145:    * right edge assuming a portrait document.
 146:    */
 147:   public static final FinishingsDefault STAPLE_DUAL_RIGHT = new FinishingsDefault(30);
 148: 
 149:   /**
 150:    * Bind the document(s) with two staples (wire stitches) along the
 151:    * bottom edge assuming a portrait document.
 152:    */
 153:   public static final FinishingsDefault STAPLE_DUAL_BOTTOM = new FinishingsDefault(31);
 154: 
 155:   private static final String[] stringTable = { "none", "staple", null,
 156:                                                 "cover", "bind", "saddle-stitch",
 157:                                                 "edge-stitch", null, null, null,
 158:                                                 null, null, null, null, null,
 159:                                                 null, null, "staple-top-left",
 160:                                                 "staple-bottom-left",
 161:                                                 "staple-top-right",
 162:                                                 "staple-bottom-right",
 163:                                                 "edge-stitch-left",
 164:                                                 "edge-stitch-top",
 165:                                                 "edge-stitch-right",
 166:                                                 "edge-stitch-bottom",
 167:                                                 "staple-dual-left",
 168:                                                 "staple-dual-top",
 169:                                                 "staple-dual-right",
 170:                                                 "staple-dual-bottom" };
 171: 
 172:   private static final FinishingsDefault[] enumValueTable = { NONE, STAPLE, null,
 173:                                                        COVER, BIND,
 174:                                                        SADDLE_STITCH,
 175:                                                        EDGE_STITCH, null,
 176:                                                        null, null, null,
 177:                                                        null, null, null,
 178:                                                        null, null, null,
 179:                                                        STAPLE_TOP_LEFT,
 180:                                                        STAPLE_BOTTOM_LEFT,
 181:                                                        STAPLE_TOP_RIGHT,
 182:                                                        STAPLE_BOTTOM_RIGHT,
 183:                                                        EDGE_STITCH_LEFT,
 184:                                                        EDGE_STITCH_TOP,
 185:                                                        EDGE_STITCH_RIGHT,
 186:                                                        EDGE_STITCH_BOTTOM,
 187:                                                        STAPLE_DUAL_LEFT,
 188:                                                        STAPLE_DUAL_TOP,
 189:                                                        STAPLE_DUAL_RIGHT,
 190:                                                        STAPLE_DUAL_BOTTOM };
 191: 
 192:   /**
 193:    * Constructs a <code>FinishingsDefault</code> object.
 194:    *
 195:    * @param value the value
 196:    */
 197:   protected FinishingsDefault(int value)
 198:   {
 199:     super(value);
 200:   }
 201: 
 202:   /**
 203:    * Returns category of this class.
 204:    *
 205:    * @return the class <code>FinishingsDefault</code> itself
 206:    */
 207:   public Class<? extends Attribute> getCategory()
 208:   {
 209:     return FinishingsDefault.class;
 210:   }
 211: 
 212:   /**
 213:    * Returns the name of this attribute.
 214:    *
 215:    * @return The name "finishings-default".
 216:    */
 217:   public String getName()
 218:   {
 219:     return "finishings-default";
 220:   }
 221: 
 222:   /**
 223:    * Returns a table with the enumeration values represented as strings
 224:    * for this object.
 225:    *
 226:    * @return The enumeration values as strings.
 227:    */
 228:   protected String[] getStringTable()
 229:   {
 230:     return stringTable;
 231:   }
 232: 
 233:   /**
 234:    * Returns a table with the enumeration values for this object.
 235:    *
 236:    * @return The enumeration values.
 237:    */
 238:   protected EnumSyntax[] getEnumValueTable()
 239:   {
 240:     return enumValueTable;
 241:   }
 242: 
 243:   /**
 244:    * Returns the lowest used value by the enumerations of this class.
 245:    * .
 246:    * @return The lowest value used.
 247:    */
 248:   protected int getOffset()
 249:   {
 250:     return 3;
 251:   }
 252: 
 253:   /**
 254:    * Returns the equally enum of the standard attribute class
 255:    * of this DefaultValuesAttribute enum.
 256:    *
 257:    * @return The enum of the standard attribute class.
 258:    */
 259:   public Attribute getAssociatedAttribute()
 260:   {
 261:     return IppUtilities.getEnumAttribute("finishings", new Integer(getValue()));
 262:   }
 263: }