Debian Codegraph @

freehep-graphicsio-cgm/src/main/java/org/freehep/graphicsio/cgm/InteriorStyleSpecificationMode.java

raw symbols SCIP
1 // Copyright 2001, FreeHEP.
2 package org.freehep.graphicsio.cgm;
3
4 import java.io.IOException;
5
6 /**
7 * InteriorStyleSpecificationMode TAG.
8 *
9 * @author Mark Donszelmann
10 * @author Charles Loomis
11 * @version $Id: InteriorStyleSpecificationMode.java 4436 2001-11-29 01:45:36Z
12 * duns $
13 */
14 public class InteriorStyleSpecificationMode extends CGMTag {
15
16 public static final int ABSOLUTE = 0;
17
18 public static final int SCALED = 1;
19
20 public static final int FRACTIONAL = 2;
21
22 public static final int MM = 3;
23
24 private int mode;
25
26 public InteriorStyleSpecificationMode() {
27 super(2, 16, 3);
28 }
29
30 public InteriorStyleSpecificationMode(int mode) {
31 this();
32 this.mode = mode;
33 }
34
35 public void write(int tagID, CGMOutputStream cgm) throws IOException {
36 cgm.setInteriorStyleSpecificationMode(mode);
37 cgm.writeEnumerate(mode);
38 }
39
40 public void write(int tagID, CGMWriter cgm) throws IOException {
41 cgm.setInteriorStyleSpecificationMode(mode);
42 cgm.print("INTSTYLEMODE ");
43 switch (mode) {
44 default:
45 case ABSOLUTE:
46 cgm.print("ABS");
47 break;
48 case SCALED:
49 cgm.print("SCALED");
50 break;
51 case FRACTIONAL:
52 cgm.print("FRACTIONAL");
53 break;
54 case MM:
55 cgm.print("METRIC");
56 break;
57 }
58 }
59 }