Debian Codegraph @

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

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