View Javadoc

1   // Copyright 2002, FreeHEP.
2   package org.freehep.graphicsio.emf.gdi;
3   
4   import java.awt.Point;
5   import java.awt.Rectangle;
6   import java.io.IOException;
7   
8   import org.freehep.graphicsio.emf.EMFInputStream;
9   import org.freehep.graphicsio.emf.EMFOutputStream;
10  import org.freehep.graphicsio.emf.EMFTag;
11  
12  /**
13   * PolyBezier16 TAG.
14   * 
15   * @author Mark Donszelmann
16   * @version $Id: PolyBezier16.java 10367 2007-01-22 19:26:48Z duns $
17   */
18  public class PolyBezier16 extends PolyBezier {
19  
20      public PolyBezier16() {
21          super(85, 1, null, 0, null);
22      }
23  
24      public PolyBezier16(Rectangle bounds, int numberOfPoints, Point[] points) {
25          super(85, 1, bounds, numberOfPoints, points);
26      }
27  
28      public EMFTag read(int tagID, EMFInputStream emf, int len)
29              throws IOException {
30  
31          Rectangle r = emf.readRECTL();
32          int n = emf.readDWORD();
33          return new PolyBezier16(r, n, emf.readPOINTS(n));
34      }
35  
36      public void write(int tagID, EMFOutputStream emf) throws IOException {
37          emf.writeRECTL(getBounds());
38          emf.writeDWORD(getNumberOfPoints());
39          emf.writePOINTS(getNumberOfPoints(), getPoints());
40      }
41  }