1 28 package net.sf.jasperreports.engine.xml; 29 30 import net.sf.jasperreports.engine.base.JRBasePrintGraphicElement; 31 32 import org.xml.sax.Attributes ; 33 34 35 39 public class JRPrintGraphicElementFactory extends JRBaseFactory 40 { 41 42 43 46 private static final String ATTRIBUTE_pen = "pen"; 47 private static final String ATTRIBUTE_fill = "fill"; 48 49 50 53 public Object createObject(Attributes atts) 54 { 55 JRBasePrintGraphicElement graphicElement = (JRBasePrintGraphicElement)digester.peek(); 56 57 Byte pen = (Byte )JRXmlConstants.getPenMap().get(atts.getValue(ATTRIBUTE_pen)); 58 if (pen != null) 59 { 60 graphicElement.setPen(pen); 61 } 62 63 Byte fill = (Byte )JRXmlConstants.getFillMap().get(atts.getValue(ATTRIBUTE_fill)); 64 if (fill != null) 65 { 66 graphicElement.setFill(fill); 67 } 68 69 return graphicElement; 70 } 71 72 73 } 74 | Popular Tags |