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