Debian Codegraph @

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

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