Debian Codegraph @

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

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