View Javadoc

1   // Copyright 2002, FreeHEP.
2   package org.freehep.graphicsio.emf.gdi;
3   
4   import java.io.IOException;
5   
6   import org.freehep.graphicsio.emf.EMFInputStream;
7   import org.freehep.graphicsio.emf.EMFTag;
8   import org.freehep.graphicsio.emf.EMFRenderer;
9   
10  /**
11   * EndPath TAG.
12   * 
13   * @author Mark Donszelmann
14   * @version $Id: EndPath.java 10367 2007-01-22 19:26:48Z duns $
15   */
16  public class EndPath extends EMFTag {
17  
18      public EndPath() {
19          super(60, 1);
20      }
21  
22      public EMFTag read(int tagID, EMFInputStream emf, int len)
23              throws IOException {
24  
25          return this;
26      }
27  
28      /**
29       * displays the tag using the renderer
30       *
31       * @param renderer EMFRenderer storing the drawing session data
32       */
33      public void render(EMFRenderer renderer) {
34          // TODO: fix EMFGraphics2D?
35          // this happens only when EMF is created by EMFGraphics2D
36          // there could be an open figure (created with LineTo, PolylineTo etc.)
37          // that is not closed and therefore not written to the currentPath
38          renderer.closeFigure();
39  
40          // The EndPath function closes a path bracket and selects the path
41          // defined by the bracket into the specified device context.
42          renderer.closePath();
43      }
44  }