View Javadoc

1   // Copyright 2002, FreeHEP.
2   package org.freehep.graphicsio.emf.gdi;
3   
4   import java.awt.Color;
5   import java.io.IOException;
6   
7   import org.freehep.graphicsio.emf.EMFInputStream;
8   import org.freehep.graphicsio.emf.EMFOutputStream;
9   
10  /**
11   * EMF TriVertex
12   * 
13   * @author Mark Donszelmann
14   * @version $Id: TriVertex.java 10140 2006-12-07 07:50:41Z duns $
15   */
16  public class TriVertex {
17  
18      private int x, y;
19  
20      private Color color;
21  
22      public TriVertex(int x, int y, Color color) {
23          this.x = x;
24          this.y = y;
25          this.color = color;
26      }
27  
28      public TriVertex(EMFInputStream emf) throws IOException {
29          x = emf.readLONG();
30          y = emf.readLONG();
31          color = emf.readCOLOR16();
32      }
33  
34      public void write(EMFOutputStream emf) throws IOException {
35          emf.writeLONG(x);
36          emf.writeLONG(y);
37          emf.writeCOLOR16(color);
38      }
39  
40      public String toString() {
41          return "[" + x + ", " + y + "] " + color;
42      }
43  }