View Javadoc

1   // Copyright 2002, FreeHEP.
2   package org.freehep.graphicsio.emf.gdi;
3   
4   import java.awt.Color;
5   import java.awt.Point;
6   import java.io.IOException;
7   
8   import org.freehep.graphicsio.emf.EMFConstants;
9   import org.freehep.graphicsio.emf.EMFInputStream;
10  import org.freehep.graphicsio.emf.EMFOutputStream;
11  import org.freehep.graphicsio.emf.EMFTag;
12  
13  /**
14   * ExtFloodFill TAG.
15   * 
16   * @author Mark Donszelmann
17   * @version $Id: ExtFloodFill.java 10367 2007-01-22 19:26:48Z duns $
18   */
19  public class ExtFloodFill extends EMFTag implements EMFConstants {
20  
21      private Point start;
22  
23      private Color color;
24  
25      private int mode;
26  
27      public ExtFloodFill() {
28          super(53, 1);
29      }
30  
31      public ExtFloodFill(Point start, Color color, int mode) {
32          this();
33          this.start = start;
34          this.color = color;
35          this.mode = mode;
36      }
37  
38      public EMFTag read(int tagID, EMFInputStream emf, int len)
39              throws IOException {
40  
41          return new ExtFloodFill(
42              emf.readPOINTL(),
43              emf.readCOLORREF(),
44              emf.readDWORD());
45      }
46  
47      public void write(int tagID, EMFOutputStream emf) throws IOException {
48          emf.writePOINTL(start);
49          emf.writeCOLORREF(color);
50          emf.writeDWORD(mode);
51      }
52  
53      public String toString() {
54          return super.toString() +
55              "\n  start: " + start +
56              "\n  color: " + color +
57              "\n  mode: " + mode;
58      }
59  }