Debian Codegraph @

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

raw symbols SCIP
1 // Copyright 2003 FreeHEP.
2 package org.freehep.graphicsio.cgm;
3
4 import java.awt.Color;
5 import java.io.IOException;
6
7 /**
8 * Transparent Cell Colour TAG.
9 *
10 * @author Ian Graham
11 */
12 public class TransparentCellColour extends CGMTag {
13 private boolean on;
14
15 private Color colour;
16
17 public TransparentCellColour() {
18 super(3, 20, 3);
19 }
20
21 public TransparentCellColour(boolean on, Color colour) {
22 this();
23 this.on = on;
24 this.colour = colour;
25 }
26
27 public void write(int tagID, CGMOutputStream cgm) throws IOException {
28 cgm.writeEnumerate(on ? 1 : 0);
29 cgm.writeColor(colour);
30 }
31
32 public void write(int tagID, CGMWriter cgm) throws IOException {
33 // TODO: TRANSPCELLCOLR UNTESTED
34 cgm.print("TRANSPCELLCOLR ");
35 cgm.print((on) ? "ON " : "OFF ");
36 cgm.writeColor(colour);
37 }
38
39 }