Debian Codegraph @

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

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