Debian Codegraph @

freehep-graphicsio-cgm/src/main/java/org/freehep/graphicsio/cgm/Circle.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 * Circle TAG.
9 *
10 * @author Mark Donszelmann
11 * @author Charles Loomis
12 * @version $Id: freehep-graphicsio-cgm/src/main/java/org/freehep/graphicsio/cgm/Circle.java 278fac7cefaa 2005/12/05 04:00:43 duns $
13 */
14 public class Circle extends CGMTag {
15
16 private Point2D p;
17
18 private double radius;
19
20 public Circle() {
21 super(4, 12, 1);
22 }
23
24 public Circle(Point2D p, double radius) {
25 this();
26 this.p = p;
27 this.radius = radius;
28 }
29
30 public void write(int tagID, CGMOutputStream cgm) throws IOException {
31 cgm.writePoint(p);
32 cgm.writeVDC(radius);
33 }
34
35 public void write(int tagID, CGMWriter cgm) throws IOException {
36 cgm.print("CIRCLE ");
37 cgm.writePoint(p);
38 cgm.print(", ");
39 cgm.writeVDC(radius);
40 }
41 }