1 28 package net.sf.jasperreports.charts.xml; 29 30 import net.sf.jasperreports.charts.design.JRDesignLinePlot; 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 JRLinePlotFactory extends JRBaseFactory { 41 private static final String ATTRIBUTE_isShowShapes = "isShowShapes"; 42 private static final String ATTRIBUTE_isShowLines = "isShowLines"; 43 44 public Object createObject( Attributes attrs ){ 45 JRChart chart = (JRChart)digester.peek(); 46 JRDesignLinePlot plot = (JRDesignLinePlot)chart.getPlot(); 47 48 String isShowShapes = attrs.getValue( ATTRIBUTE_isShowShapes ); 49 if( isShowShapes != null && isShowShapes.length() > 0 ){ 50 plot.setShowShapes(Boolean.valueOf(isShowShapes).booleanValue() ); 51 } 52 53 String isShowLines = attrs.getValue( ATTRIBUTE_isShowLines ); 54 if( isShowLines != null && isShowLines.length() > 0 ){ 55 plot.setShowLines(Boolean.valueOf(isShowLines).booleanValue() ); 56 } 57 58 return plot; 59 } 60 } 61 | Popular Tags |