1 42 43 package org.jfree.xml.writer.coretypes; 44 45 import java.awt.geom.Point2D ; 46 import java.io.IOException ; 47 48 import org.jfree.xml.writer.AbstractXmlWriteHandler; 49 import org.jfree.xml.writer.AttributeList; 50 import org.jfree.xml.writer.XMLWriter; 51 import org.jfree.xml.writer.XMLWriterException; 52 53 56 public class Point2DWriteHandler extends AbstractXmlWriteHandler { 57 58 61 public Point2DWriteHandler() { 62 super(); 63 } 64 65 77 public void write(final String tagName, final Object object, final XMLWriter writer, 78 final String mPlexAttribute, final String mPlexValue) 79 throws IOException , XMLWriterException { 80 final Point2D point = (Point2D ) object; 81 final double x = point.getX(); 82 final double y = point.getY(); 83 final AttributeList attribs = new AttributeList(); 84 if (mPlexAttribute != null) { 85 attribs.setAttribute(mPlexAttribute, mPlexValue); 86 } 87 attribs.setAttribute("x", String.valueOf(x)); 88 attribs.setAttribute("y", String.valueOf(y)); 89 writer.writeTag(tagName, attribs, true); 90 } 91 } 92 | Popular Tags |