1 23 24 package de.laures.cewolf.taglib.tags; 25 26 import java.util.Map ; 27 28 import javax.servlet.jsp.JspException ; 29 30 import de.laures.cewolf.DatasetProducer; 31 import de.laures.cewolf.taglib.DataAware; 32 import de.laures.cewolf.taglib.PlotContainer; 33 import de.laures.cewolf.taglib.PlotDefinition; 34 import de.laures.cewolf.taglib.TaglibConstants; 35 36 40 public class PlotTag extends CewolfTag implements TaglibConstants, DataAware { 41 42 private PlotDefinition plotDefinition = new PlotDefinition(); 43 44 public int doStartTag() throws JspException { 45 return EVAL_BODY_INCLUDE; 46 } 47 48 public int doEndTag() throws JspException { 49 PlotContainer pc = (PlotContainer)findAncestorWithClass(this, PlotContainer.class); 50 if (pc == null) { 51 throw new JspException ("<plot> must be nested in a PlotContainer tag like <overlaid-chart>"); 52 } 53 pc.addPlot(plotDefinition); 54 return doAfterEndTag(EVAL_PAGE); 55 } 56 57 public void reset() { 58 plotDefinition = new PlotDefinition(); 59 } 60 61 65 public void setType(String type) { 66 plotDefinition.setType(type); 67 } 68 69 public void setDataProductionConfig(DatasetProducer dsp, Map params, boolean useCache) { 70 plotDefinition.setDataProductionConfig(dsp, params, useCache); 71 } 72 73 77 public void setXaxislabel(String xAxisLabel) { 78 plotDefinition.setXaxislabel(xAxisLabel); 79 } 80 81 85 public void setYaxislabel(String yAxisLabel) { 86 plotDefinition.setYaxislabel(yAxisLabel); 87 } 88 89 90 } 91 | Popular Tags |