示例#1
0
 public Object build(XmlElement elt, String type) throws Exception {
   Class c = this.getClass().forName(type);
   TextAnnotations ta = (TextAnnotations) c.newInstance();
   ta.setCharWidth(Double.parseDouble(elt.getAttribute(CHAR_WIDTH)));
   ta.setCharHeight(Double.parseDouble(elt.getAttribute(CHAR_HEIGHT)));
   return ta;
 }
示例#2
0
 public XmlElement generate(Object in) throws Exception {
   TextAnnotations ta = (TextAnnotations) in;
   XmlElement out = new XmlElement(in.getClass().getName());
   out.setAttribute(CHAR_WIDTH, Double.toString(ta.getCharWidth()));
   out.setAttribute(CHAR_HEIGHT, Double.toString(ta.getCharHeight()));
   return out;
 }