001    /* MediaSizeName.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.EnumSyntax;
041    
042    /**
043     * <code>MediaSizeName</code> is a subclass of the <code>Media</code> printing 
044     * attribute and provides selection of media to be used by the means of 
045     * defined size names. The class pre-defines commonly available media sizes. 
046     * This media type enumeration may be used in alternative to 
047     * MediaName/MediaTray.
048     * <p>
049     * <b>IPP Compatibility:</b> MediaSizeName is not an IPP 1.1 attribute on its 
050     * own. It provides parts of the <code>media</code> attribute type values.
051     * </p>
052     * 
053     * @author Michael Koch (konqueror@gmx.de)
054     * @author Wolfgang Baer (WBaer@gmx.de)
055     */
056    public class MediaSizeName extends Media
057    {
058      private static final long serialVersionUID = 2778798329756942747L;
059    
060      /**
061       * The ISO A0 size: 841 mm by 1189 mm.
062       */
063      public static final MediaSizeName ISO_A0 = new MediaSizeName(0);
064      
065      /**
066       * The ISO A1 size: 594 mm by 841 mm.
067       */
068      public static final MediaSizeName ISO_A1 = new MediaSizeName(1);
069      
070      /**
071       * The ISO A2 size: 420 mm by 594 mm.
072       */
073      public static final MediaSizeName ISO_A2 = new MediaSizeName(2);
074      
075      /**
076       * The ISO A3 size: 297 mm by 420 mm.
077       */
078      public static final MediaSizeName ISO_A3 = new MediaSizeName(3);
079      
080      /**
081       * The ISO A4 size: 210 mm by 297 mm.
082       */
083      public static final MediaSizeName ISO_A4 = new MediaSizeName(4);
084      
085      /**
086       * The ISO A5 size: 148 mm by 210 mm.
087       */
088      public static final MediaSizeName ISO_A5 = new MediaSizeName(5);
089      
090      /**
091       * The ISO A6 size: 105 mm by 148 mm.
092       */
093      public static final MediaSizeName ISO_A6 = new MediaSizeName(6);
094      
095      /**
096       * The ISO A7 size: 74 mm by 105 mm.
097       */
098      public static final MediaSizeName ISO_A7 = new MediaSizeName(7);
099      
100      /**
101       * The ISO A8 size: 52 mm by 74 mm.
102       */
103      public static final MediaSizeName ISO_A8 = new MediaSizeName(8);
104      
105      /**
106       * The ISO A9 size: 37 mm by 52 mm.
107       */
108      public static final MediaSizeName ISO_A9 = new MediaSizeName(9);
109      
110      /**
111       * The ISO A10 size: 26 mm by 37 mm.
112       */
113      public static final MediaSizeName ISO_A10 = new MediaSizeName(10);
114      
115      /**
116       * The ISO B0 size: 1000 mm by 1414 mm.
117       */
118      public static final MediaSizeName ISO_B0 = new MediaSizeName(11);
119      
120      /**
121       * The ISO B1 size: 707 mm by 1000 mm.
122       */
123      public static final MediaSizeName ISO_B1 = new MediaSizeName(12);
124      
125      /**
126       * The ISO B2 size: 500 mm by 707 mm.
127       */
128      public static final MediaSizeName ISO_B2 = new MediaSizeName(13);
129      
130      /**
131       * The ISO B3 size: 353 mm by 500 mm.
132       */
133      public static final MediaSizeName ISO_B3 = new MediaSizeName(14);
134      
135      /**
136       * The ISO B4 size: 250 mm by 353 mm.
137       */
138      public static final MediaSizeName ISO_B4 = new MediaSizeName(15);
139      
140      /**
141       * The ISO B5 size: 176 mm by 250 mm.
142       */
143      public static final MediaSizeName ISO_B5 = new MediaSizeName(16);
144      
145      /**
146       * The ISO B6 size: 125 mm by 176 mm.
147       */
148      public static final MediaSizeName ISO_B6 = new MediaSizeName(17);
149      
150      /**
151       * The ISO B7 size: 88 mm by 125 mm.
152       */
153      public static final MediaSizeName ISO_B7 = new MediaSizeName(18);
154      
155      /**
156       * The ISO B8 size: 62 mm by 88 mm.
157       */
158      public static final MediaSizeName ISO_B8 = new MediaSizeName(19);
159      
160      /**
161       * The ISO B9 size: 44 mm by 62 mm.
162       */
163      public static final MediaSizeName ISO_B9 = new MediaSizeName(20);
164      
165      /**
166       * The ISO B10 size: 31 mm by 44 mm.
167       */
168      public static final MediaSizeName ISO_B10 = new MediaSizeName(21);
169      
170      /**
171       * The JIS B0 size: 1030mm x 1456mm.
172       */
173      public static final MediaSizeName JIS_B0 = new MediaSizeName(22);
174      
175      /**
176       * The JIS B1 size: 728mm x 1030mm.
177       */
178      public static final MediaSizeName JIS_B1 = new MediaSizeName(23);
179      
180      /**
181       * The JIS B2 size: 515mm x 728mm.
182       */
183      public static final MediaSizeName JIS_B2 = new MediaSizeName(24);
184      
185      /**
186       * The JIS B3 size: 364mm x 515mm.
187       */
188      public static final MediaSizeName JIS_B3 = new MediaSizeName(25);
189      
190      /**
191       * The JIS B4 size: 257mm x 364mm.
192       */
193      public static final MediaSizeName JIS_B4 = new MediaSizeName(26);
194      
195      /**
196       * The JIS B5 size: 182mm x 257mm.
197       */
198      public static final MediaSizeName JIS_B5 = new MediaSizeName(27);
199      
200      /**
201       * The JIS B6 size: 128mm x 182mm.
202       */
203      public static final MediaSizeName JIS_B6 = new MediaSizeName(28);
204      
205      /**
206       * The JIS B7 size: 91mm x 128mm.
207       */
208      public static final MediaSizeName JIS_B7 = new MediaSizeName(29);
209      
210      /**
211       * The JIS B8 size: 64mm x 91mm.
212       */
213      public static final MediaSizeName JIS_B8 = new MediaSizeName(30);
214      
215      /**
216       * The JIS B9 size: 45mm x 64mm.
217       */
218      public static final MediaSizeName JIS_B9 = new MediaSizeName(31);
219      
220      /**
221       * The JIS B10 size: 32mm x 45mm.
222       */
223      public static final MediaSizeName JIS_B10 = new MediaSizeName(32);
224      
225      /**
226       * The ISO C0 size: 917 mm by 1297 mm.
227       */
228      public static final MediaSizeName ISO_C0 = new MediaSizeName(33);
229      
230      /**
231       * The ISO C1 size: 648 mm by 917 mm.
232       */
233      public static final MediaSizeName ISO_C1 = new MediaSizeName(34);
234      
235      /**
236       * The ISO C2 size: 458 mm by 648 mm.
237       */
238      public static final MediaSizeName ISO_C2 = new MediaSizeName(35);
239      
240      /**
241       * The ISO C3 size: 324 mm by 458 mm.
242       */
243      public static final MediaSizeName ISO_C3 = new MediaSizeName(36);
244      
245      /**
246       * The ISO C4 size: 229 mm by 324 mm.
247       */
248      public static final MediaSizeName ISO_C4 = new MediaSizeName(37);
249      
250      /**
251       * The ISO C5 size: 162 mm by 229 mm.
252       */
253      public static final MediaSizeName ISO_C5 = new MediaSizeName(38);
254      
255      /**
256       * The ISO C6 size: 114 mm by 162 mm.
257       */
258      public static final MediaSizeName ISO_C6 = new MediaSizeName(39);
259      
260      /**
261       * The North American letter size: 8.5 inches by 11 inches.
262       */
263      public static final MediaSizeName NA_LETTER = new MediaSizeName(40);
264      
265      /**
266       * The North American legal size: 8.5 inches by 14 inches.
267       */
268      public static final MediaSizeName NA_LEGAL = new MediaSizeName(41);
269      
270      /**
271       * The executive size: 7.25 inches by 10.5 inches.
272       */
273      public static final MediaSizeName EXECUTIVE = new MediaSizeName(42);
274      
275      /**
276       * The ledger size: 11 inches by 17 inches.
277       */
278      public static final MediaSizeName LEDGER = new MediaSizeName(43);
279      
280      /**
281       * The tabloid size: 11 inches by 17 inches.
282       */
283      public static final MediaSizeName TABLOID = new MediaSizeName(44);
284      
285      /**
286       * The invoice size: 5.5 inches by 8.5 inches.
287       */
288      public static final MediaSizeName INVOICE = new MediaSizeName(45);
289      
290      /**
291       * The folio size: 8.5 inches by 13 inches.
292       */
293      public static final MediaSizeName FOLIO = new MediaSizeName(46);
294      
295      /**
296       * The quarto size: 8.5 inches by 10.83 inches.
297       */
298      public static final MediaSizeName QUARTO = new MediaSizeName(47);
299      
300      /**
301       * The Japanese postcard size, 100 mm by 148 mm.
302       */
303      public static final MediaSizeName JAPANESE_POSTCARD = new MediaSizeName(48);
304      
305      /**
306       * The Japanese Double postcard size: 148 mm by 200 mm.
307       */
308      public static final MediaSizeName JAPANESE_DOUBLE_POSTCARD =
309        new MediaSizeName(49);
310      
311      /**
312       * The engineering ANSI A size medium: 8.5 inches x 11 inches.
313       */
314      public static final MediaSizeName A = new MediaSizeName(50);
315      
316      /**
317       * The engineering ANSI B size medium: 11 inches x 17 inches.
318       */
319      public static final MediaSizeName B = new MediaSizeName(51);
320      
321      /**
322       * The engineering ANSI C size medium: 17 inches x 22 inches.
323       */
324      public static final MediaSizeName C = new MediaSizeName(52);
325      
326      /**
327       * The engineering ANSI D size medium: 22 inches x 34 inches.
328       */
329      public static final MediaSizeName D = new MediaSizeName(53);
330      
331      /**
332       * The engineering ANSI E size medium: 34 inches x 44 inches.
333       */
334      public static final MediaSizeName E = new MediaSizeName(54);
335      
336      /**
337       * The ISO Designated Long size: 110 mm by 220 mm.
338       */
339      public static final MediaSizeName ISO_DESIGNATED_LONG =
340        new MediaSizeName(55);
341      
342      /**
343       * The Italy envelope size: 110 mm by 230 mm.
344       */
345      public static final MediaSizeName ITALY_ENVELOPE = new MediaSizeName(56);
346      
347      /**
348       * The Monarch envelope size: 3.87 inch by 7.5 inch.
349       */
350      public static final MediaSizeName MONARCH_ENVELOPE = new MediaSizeName(57);
351      
352      /**
353       * The Personal envelope size: 3.625 inch by 6.5 inch.
354       */
355      public static final MediaSizeName PERSONAL_ENVELOPE = new MediaSizeName(58);
356      
357      /**
358       * The North American number 9 business envelope size: 
359       * 3.875 inches by 8.875 inches.
360       */
361      public static final MediaSizeName NA_NUMBER_9_ENVELOPE =
362        new MediaSizeName(59);
363      
364      /**
365       * The North American number 10 business envelope size:  
366       * 4.125 inches by 9.5 inches.
367       */
368      public static final MediaSizeName NA_NUMBER_10_ENVELOPE =
369        new MediaSizeName(60);
370      
371      /**
372       * The North American number 11 business envelope size: 
373       * 4.5 inches by 10.375 inches.
374       */
375      public static final MediaSizeName NA_NUMBER_11_ENVELOPE =
376        new MediaSizeName(61);
377      
378      /**
379       * The North American number 12 business envelope size: 
380       * 4.75 inches by 11 inches.
381       */
382      public static final MediaSizeName NA_NUMBER_12_ENVELOPE =
383        new MediaSizeName(62);
384      
385      /**
386       * The North American number 14 business envelope size: 
387       * 5 inches by 11.5 inches.
388       */
389      public static final MediaSizeName NA_NUMBER_14_ENVELOPE =
390        new MediaSizeName(63);
391      
392      /**
393       * The North American 6x9 inch envelope size.
394       */
395      public static final MediaSizeName NA_6X9_ENVELOPE = new MediaSizeName(64);
396      
397      /**
398       * The North American 7x9 inch envelope size.
399       */
400      public static final MediaSizeName NA_7X9_ENVELOPE = new MediaSizeName(65);
401      
402      /**
403       * The North American 9x11 inch envelope size.
404       */
405      public static final MediaSizeName NA_9X11_ENVELOPE = new MediaSizeName(66);
406      
407      /**
408       * The North American 9x12 inch envelope size.
409       */
410      public static final MediaSizeName NA_9X12_ENVELOPE = new MediaSizeName(67);
411      
412      /**
413       * The North American 10x13 inch envelope size.
414       */
415      public static final MediaSizeName NA_10X13_ENVELOPE = new MediaSizeName(68);
416      
417      /**
418       * The North American 10x14 inch envelope size.
419       */
420      public static final MediaSizeName NA_10X14_ENVELOPE = new MediaSizeName(69);
421      
422      /**
423       * The North American 10x15 inch envelope size.
424       */
425      public static final MediaSizeName NA_10X15_ENVELOPE = new MediaSizeName(70);
426      
427      /**
428       * The North American 5 inches by 7 inches.
429       */
430      public static final MediaSizeName NA_5X7 = new MediaSizeName(71);
431      
432      /**
433       * The North American 8 inches by 10 inches.
434       */
435      public static final MediaSizeName NA_8X10 = new MediaSizeName(72);
436    
437      private static final String[] stringTable = 
438        { "iso-a0",  "iso-a1", "iso-a2", "iso-a3", "iso-a4", "iso-a5", "iso-a6", 
439          "iso-a7", "iso-a8", "iso-a9", "iso-a10", "iso-b0", "iso-b1", "iso-b2", 
440          "iso-b3", "iso-b4", "iso-b5", "iso-b6", "iso-b7", "iso-b8", "iso-b9", 
441          "iso-b10", "jis-b0", "jis-b1", "jis-b2", "jis-b3", "jis-b4", "jis-b5", 
442          "jis-b6", "jis-b7", "jis-b8", "jis-b9", "jis-b10", "iso-c0", "iso-c1", 
443          "iso-c2", "iso-c3", "iso-c4", "iso-c5", "iso-c6", "na-letter", 
444          "na-legal", "executive", "ledger", "tabloid", "invoice", "folio", 
445          "quarto", "japanese-postcard", "oufuko-postcard", "a", "b", "c", "d", 
446          "e", "iso-designated-long", "italian-envelope", "monarch-envelope", 
447          "personal-envelope", "na-number-9-envelope", "na-number-10-envelope", 
448          "na-number-11-envelope", "na-number-12-envelope", 
449          "na-number-14-envelope", "na-6x9-envelope", "na-7x9-envelope", 
450          "na-9x11-envelope", "na-9x12-envelope", "na-10x13-envelope", 
451          "na-10x14-envelope", "na-10x15-envelope", "na-5x7", "na-8x10" };
452      
453      private static final MediaSizeName[] enumValueTable = 
454        { ISO_A0, ISO_A1, ISO_A2, ISO_A3, ISO_A4, ISO_A5, ISO_A6, ISO_A7, ISO_A8, 
455          ISO_A9, ISO_A10, ISO_B0, ISO_B1, ISO_B2, ISO_B3, ISO_B4, ISO_B5, ISO_B6,
456          ISO_B7, ISO_B8, ISO_B9, ISO_B10, JIS_B0, JIS_B1, JIS_B2, JIS_B3, JIS_B4, 
457          JIS_B5, JIS_B6, JIS_B7, JIS_B8, JIS_B9, JIS_B10, ISO_C0, ISO_C1, ISO_C2,
458          ISO_C3, ISO_C4, ISO_C5, ISO_C6, NA_LETTER, NA_LEGAL, EXECUTIVE, LEDGER, 
459          TABLOID, INVOICE, FOLIO, QUARTO, JAPANESE_POSTCARD, 
460          JAPANESE_DOUBLE_POSTCARD, A, B, C, D, E, ISO_DESIGNATED_LONG, 
461          ITALY_ENVELOPE, MONARCH_ENVELOPE, PERSONAL_ENVELOPE, 
462          NA_NUMBER_9_ENVELOPE, NA_NUMBER_10_ENVELOPE, NA_NUMBER_11_ENVELOPE,
463          NA_NUMBER_12_ENVELOPE, NA_NUMBER_14_ENVELOPE, NA_6X9_ENVELOPE,
464          NA_7X9_ENVELOPE, NA_9X11_ENVELOPE, NA_9X12_ENVELOPE, NA_10X13_ENVELOPE,
465          NA_10X14_ENVELOPE, NA_10X15_ENVELOPE, NA_5X7, NA_8X10 }; 
466      
467      /**
468       * Constructs a <code>MediaSizeName</code> object.
469       * 
470       * @param value the enum value.
471       */
472      protected MediaSizeName(int value)
473      {
474        super(value);
475      }
476    
477      /**
478       * Returns a table with the enumeration values represented as strings
479       * for this object.
480       *
481       * @return The enumeration values as strings.
482       */
483      protected String[] getStringTable()
484      {
485        return stringTable;
486      }
487    
488      /**
489       * Returns a table with the enumeration values for this object.
490       *
491       * @return The enumeration values.
492       */
493      protected EnumSyntax[] getEnumValueTable()
494      {
495        return enumValueTable;
496      }
497    }