Debian Codegraph @

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

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