| 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 |
import org.freehep.graphicsio.emf.EMFRenderer; |
| 11 |
|
| 12 |
/** |
| 13 |
* SetBrushOrgEx TAG. |
| 14 |
* |
| 15 |
* @author Mark Donszelmann |
| 16 |
* @version $Id: freehep-graphicsio-emf/src/main/java/org/freehep/graphicsio/emf/gdi/SetBrushOrgEx.java c0f15e7696d3 2007/01/22 19:26:48 duns $ |
| 17 |
*/ |
| 18 |
public class SetBrushOrgEx extends EMFTag { |
| 19 |
|
| 20 |
private Point point; |
| 21 |
|
| 22 |
public SetBrushOrgEx() { |
| 23 |
super(13, 1); |
| 24 |
} |
| 25 |
|
| 26 |
public SetBrushOrgEx(Point point) { |
| 27 |
this(); |
| 28 |
this.point = point; |
| 29 |
} |
| 30 |
|
| 31 |
public EMFTag read(int tagID, EMFInputStream emf, int len) |
| 32 |
throws IOException { |
| 33 |
|
| 34 |
return new SetBrushOrgEx(emf.readPOINTL()); |
| 35 |
} |
| 36 |
|
| 37 |
public void write(int tagID, EMFOutputStream emf) throws IOException { |
| 38 |
emf.writePOINTL(point); |
| 39 |
} |
| 40 |
|
| 41 |
public String toString() { |
| 42 |
return super.toString() + "\n point: " + point; |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* displays the tag using the renderer |
| 47 |
* |
| 48 |
* @param renderer EMFRenderer storing the drawing session data |
| 49 |
*/ |
| 50 |
public void render(EMFRenderer renderer) { |
| 51 |
// The SetBrushOrgEx function sets the brush origin that GDI assigns to |
| 52 |
// the next (only to the next!) brush an application selects into the specified |
| 53 |
// device context. |
| 54 |
renderer.setBrushOrigin(point); |
| 55 |
} |
| 56 |
} |