Package de.laures.cewolf

Examples of de.laures.cewolf.ChartPostProcessor


    private static final Log log = LogFactory.getLog(ChartPostProcessorTag.class);

  static final long serialVersionUID = 2608233610238632442L;

    public int doEndTag() throws JspException {
        ChartPostProcessor pp = null;
        try {
            pp = (ChartPostProcessor) getObject();
            if (pp == null) {
                throw new JspException("Could not find ChartPostProcessor under ID '" + getId() + "'");
            }
        } catch (ClassCastException cce) {
            throw new JspException("Bean under ID '" + getId() + "' is of type '"
            + getObject().getClass().getName() + "'.\nType expected:" + ChartPostProcessor.class.getName());
        }
        AbstractChartTag rt = (AbstractChartTag) PageUtils.findRoot(this, pageContext);
        ChartPostProcessor cpp = (ChartPostProcessor) getObject();
    if (cpp instanceof Serializable) {
      rt.addChartPostProcessor(cpp, getParameters());
    } else if (cpp instanceof NonSerializableChartPostProcessor) {
      rt.addChartPostProcessor(((NonSerializableChartPostProcessor) cpp).getSerializablePostProcessor(), getParameters());
    } else {
      log.error("ChartPostProcessor "+cpp.getClass().getName()+" implements neither Serializable nor NonSerializableChartPostProcessor. It will be ignored.");
    }
        return doAfterEndTag(EVAL_PAGE);
    }
View Full Code Here


        }
      }

            // postProcessing
      for (int i = 0; i < postProcessors.size(); i++) {
        ChartPostProcessor cpp = (ChartPostProcessor) postProcessors.get(i);
        try {
          cpp.processChart(chart, (Map) postProcessorsParams.get(i));
        } catch (Throwable t) {
          t.printStackTrace();
          throw new PostProcessingException(t.getClass().getName() + " raised by post processor '" +
              cpp + "'.\nPost processing of this post processor " + "has been ignored.");
        }
View Full Code Here

   * @param renderedImage The fresh image just got rendered
   */
  public void onImageRendered (RenderedImage renderedImage) {
    // if the postprocessor implements ImageRenderListener interface call it!
        for (int i = 0; i < postProcessors.size(); i++) {
            ChartPostProcessor cpp = (ChartPostProcessor)postProcessors.get(i);
            if (cpp instanceof ChartImageRenderListener) {
              ((ChartImageRenderListener) cpp).onImageRendered(renderedImage);
            }
        }
  }
View Full Code Here

* @author  Guido Laures
*/
public class ChartPostProcessorTag extends AbstractParameterizedObjectTag {

    public int doEndTag() throws JspException {
        ChartPostProcessor pp = null;
        try {
            pp = (ChartPostProcessor)getObject();
            if (pp == null) {
                throw new JspException("Could not find ChartEnhanncer under ID '" + getId() + "'");
            }
        } catch (ClassCastException cce) {
            throw new JspException("Bean under ID '" + getId() + "' is of type '"
            + pp.getClass().getName() +
            "'.\nType expected:" + ChartPostProcessor.class.getName());
        }
        AbstractChartTag rt = (AbstractChartTag)PageUtils.findRoot(this, pageContext);
        rt.addChartPostProcessor((ChartPostProcessor)getObject(), getParameters());
        return doAfterEndTag(EVAL_PAGE);
View Full Code Here

            {
              this.removeLegend();
            }
            // postProcessing
            for (int i = 0; i < postProcessors.size(); i++) {
                ChartPostProcessor pp = (ChartPostProcessor)postProcessors.get(i);
                try {
                    pp.processChart(chart, (Map)postProcessorsParams.get(i));
                } catch (Throwable t) {
                  log.error(t);
                    throw new PostProcessingException(t.getClass().getName() + " raised by post processor '" +
                        pp + "'.\nPost processing of this post processor " + "has been ignored.");
                }
View Full Code Here

   * @param renderedImage The fresh image just got rendered
   */
  public void onImageRendered (RenderedImage renderedImage) {
    // if the postprocessor implements ImageRenderListener interface call it!
        for (int i = 0; i < postProcessors.size(); i++) {
            ChartPostProcessor pp = (ChartPostProcessor)postProcessors.get(i);
            if (pp instanceof ChartImageRenderListener) {
              ((ChartImageRenderListener) pp).onImageRendered(renderedImage);
            }
        }   
  }
View Full Code Here

TOP

Related Classes of de.laures.cewolf.ChartPostProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.