1 28 package net.sf.jasperreports.charts.xml; 29 30 import net.sf.jasperreports.charts.design.JRDesignHighLowPlot; 31 import net.sf.jasperreports.engine.JRChart; 32 import net.sf.jasperreports.engine.xml.JRBaseFactory; 33 34 import org.xml.sax.Attributes ; 35 36 37 41 public class JRHighLowPlotFactory extends JRBaseFactory 42 { 43 44 private static final String ATTRIBUTE_isShowOpenTicks = "isShowOpenTicks"; 45 private static final String ATTRIBUTE_isShowCloseTicks = "isShowCloseTicks"; 46 47 48 51 public Object createObject(Attributes atts) 52 { 53 JRChart chart = (JRChart) digester.peek(); 54 JRDesignHighLowPlot plot = (JRDesignHighLowPlot)chart.getPlot(); 55 56 String isShowOpenTicks = atts.getValue(ATTRIBUTE_isShowOpenTicks); 57 if (isShowOpenTicks != null && isShowOpenTicks.length() > 0) { 58 plot.setShowOpenTicks(Boolean.valueOf(isShowOpenTicks).booleanValue()); 59 } 60 61 String isShowCloseTicks = atts.getValue(ATTRIBUTE_isShowCloseTicks); 62 if (isShowCloseTicks != null && isShowCloseTicks.length() > 0) { 63 plot.setShowCloseTicks(Boolean.valueOf(isShowCloseTicks).booleanValue()); 64 } 65 66 return plot; 67 } 68 } 69 | Popular Tags |