1 28 package net.sf.jasperreports.engine.xml; 29 30 import net.sf.jasperreports.engine.JasperPrint; 31 import net.sf.jasperreports.engine.base.JRBasePrintRectangle; 32 33 import org.xml.sax.Attributes ; 34 35 36 40 public class JRPrintRectangleFactory extends JRBaseFactory 41 { 42 43 44 47 private static final String ATTRIBUTE_radius = "radius"; 48 49 50 53 public Object createObject(Attributes atts) 54 { 55 JasperPrint jasperPrint = (JasperPrint)digester.peek(digester.getCount() - 2); 56 57 JRBasePrintRectangle rectangle = new JRBasePrintRectangle(jasperPrint.getDefaultStyleProvider()); 58 59 String radius = atts.getValue(ATTRIBUTE_radius); 60 if (radius != null && radius.length() > 0) 61 { 62 rectangle.setRadius(Integer.parseInt(radius)); 63 } 64 65 return rectangle; 66 } 67 68 69 } 70 | Popular Tags |