1 28 package net.sf.jasperreports.charts.xml; 29 30 import net.sf.jasperreports.charts.design.JRDesignBar3DPlot; 31 import net.sf.jasperreports.engine.JRChart; 32 import net.sf.jasperreports.engine.xml.JRBaseFactory; 33 34 import org.xml.sax.Attributes ; 35 36 40 public class JRBar3DPlotFactory extends JRBaseFactory { 41 private static final String ATTRIBUTE_xOffset = "xOffset"; 42 private static final String ATTRIBUTE_yOffset = "yOffset"; 43 private static final String ATTRIBUTE_isShowLabels = "isShowLabels"; 44 45 public Object createObject(Attributes atts) 46 { 47 JRChart chart = (JRChart) digester.peek(); 48 JRDesignBar3DPlot plot = (JRDesignBar3DPlot)chart.getPlot(); 49 50 String xOffset = atts.getValue(ATTRIBUTE_xOffset); 51 if (xOffset != null && xOffset.length() > 0) { 52 plot.setXOffset(Double.parseDouble(xOffset)); 53 } 54 55 String yOffset = atts.getValue(ATTRIBUTE_yOffset); 56 if (yOffset != null && yOffset.length() > 0) { 57 plot.setYOffset(Double.parseDouble(yOffset)); 58 } 59 60 String isShowLabels = atts.getValue( ATTRIBUTE_isShowLabels ); 61 if( isShowLabels != null && isShowLabels.length() > 0 ){ 62 plot.setShowLabels(Boolean.valueOf(isShowLabels).booleanValue()); 63 } 64 65 return plot; 66 } 67 68 } 69 | Popular Tags |