Debian Codegraph @

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

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