Debian Codegraph @

freehep-graphicsio-cgm/src/main/java/org/freehep/graphicsio/cgm/EllipticalArcClose.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 * EllipticalArcClose TAG.
9 *
10 * @author Mark Donszelmann
11 * @author Charles Loomis
12 * @version $Id: freehep-graphicsio-cgm/src/main/java/org/freehep/graphicsio/cgm/EllipticalArcClose.java 278fac7cefaa 2005/12/05 04:00:43 duns $
13 */
14 public class EllipticalArcClose extends EllipticalArc {
15
16 public static final int PIE = 0;
17
18 public static final int CHORD = 1;
19
20 private int closure;
21
22 public EllipticalArcClose() {
23 super(4, 19, 1);
24 }
25
26 public EllipticalArcClose(Point2D p, Point2D c1, Point2D c2,
27 Point2D delta0, Point2D delta1, int closure) {
28 this();
29 this.p = p;
30 this.c1 = c1;
31 this.c2 = c2;
32 this.delta0 = delta0;
33 this.delta1 = delta1;
34 }
35
36 public void write(int tagID, CGMOutputStream cgm) throws IOException {
37 super.write(tagID, cgm);
38 cgm.writeEnumerate(closure);
39 }
40
41 public void write(int tagID, CGMWriter cgm) throws IOException {
42 cgm.print("ELLIPARCCLOSE ");
43 writeEllipseSpec(cgm);
44 writeArcBounds(cgm);
45 cgm.print((closure == PIE) ? " PIE" : " CHORD");
46 }
47 }