1 28 package net.sf.jasperreports.crosstabs.xml; 29 30 import net.sf.jasperreports.crosstabs.design.JRDesignCrosstabCell; 31 import net.sf.jasperreports.engine.xml.JRBaseFactory; 32 33 import org.xml.sax.Attributes ; 34 35 39 public class JRCrosstabCellFactory extends JRBaseFactory 40 { 41 public static final String ATTRIBUTE_rowTotalGroup = "rowTotalGroup"; 42 public static final String ATTRIBUTE_columnTotalGroup = "columnTotalGroup"; 43 public static final String ATTRIBUTE_width = "width"; 44 public static final String ATTRIBUTE_height = "height"; 45 46 public Object createObject(Attributes attributes) 47 { 48 JRDesignCrosstabCell cell = new JRDesignCrosstabCell(); 49 50 cell.setRowTotalGroup(attributes.getValue(ATTRIBUTE_rowTotalGroup)); 51 cell.setColumnTotalGroup(attributes.getValue(ATTRIBUTE_columnTotalGroup)); 52 53 String widthAttr = attributes.getValue(ATTRIBUTE_width); 54 if (widthAttr != null) 55 { 56 cell.setWidth(new Integer (widthAttr)); 57 } 58 59 String heightAttr = attributes.getValue(ATTRIBUTE_height); 60 if (heightAttr != null) 61 { 62 cell.setHeight(new Integer (heightAttr)); 63 } 64 65 return cell; 66 } 67 } 68 | Popular Tags |