| 1 |
|
| 2 |
package org.freehep.graphicsio.cgm; |
| 3 |
|
| 4 |
import java.awt.geom.Point2D; |
| 5 |
import java.io.IOException; |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 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 |
} |