View Javadoc

1   // Copyright 2002, FreeHEP.
2   package org.freehep.graphicsio.emf.gdi;
3   
4   import java.awt.Point;
5   import java.io.IOException;
6   
7   import org.freehep.graphicsio.emf.EMFInputStream;
8   import org.freehep.graphicsio.emf.EMFOutputStream;
9   import org.freehep.graphicsio.emf.EMFTag;
10  
11  /**
12   * OffsetClipRgn TAG.
13   * 
14   * @author Mark Donszelmann
15   * @version $Id: OffsetClipRgn.java 10367 2007-01-22 19:26:48Z duns $
16   */
17  public class OffsetClipRgn extends EMFTag {
18  
19      private Point offset;
20  
21      public OffsetClipRgn() {
22          super(26, 1);
23      }
24  
25      public OffsetClipRgn(Point offset) {
26          this();
27          this.offset = offset;
28      }
29  
30      public EMFTag read(int tagID, EMFInputStream emf, int len)
31              throws IOException {
32  
33          return new OffsetClipRgn(emf.readPOINTL());
34      }
35  
36      public void write(int tagID, EMFOutputStream emf) throws IOException {
37          emf.writePOINTL(offset);
38      }
39  
40      public String toString() {
41          return super.toString() + "\n  offset: " + offset;
42      }
43  }