ingo@297: package de.intevation.gnv.chart; ingo@297: ingo@297: import java.util.Collection; ingo@297: import java.util.Locale; ingo@297: import java.awt.Transparency; ingo@297: import java.awt.image.BufferedImage; ingo@297: ingo@297: import org.apache.log4j.Logger; ingo@297: ingo@297: import org.jfree.chart.JFreeChart; ingo@297: import org.jfree.chart.ChartTheme; ingo@297: ingo@297: /** ingo@297: * @author Ingo Weinzierl ingo@297: */ ingo@297: public abstract class AbstractChart ingo@297: implements Chart ingo@297: { ingo@297: private static Logger log = Logger.getLogger(AbstractChart.class); ingo@297: ingo@297: protected JFreeChart chart; ingo@297: ingo@297: protected Locale locale; ingo@297: ingo@297: protected ChartLabels labels; ingo@297: protected ChartTheme theme; ingo@297: protected Collection parameters; ingo@297: protected Collection measurements; ingo@297: protected Collection resultSet; ingo@297: protected Collection dates; ingo@310: protected Collection timeGaps; ingo@297: ingo@297: public abstract JFreeChart generateChart(); ingo@297: ingo@303: public BufferedImage exportImage(int width, int height) { ingo@297: log.info("export chart as png"); ingo@297: ingo@297: return chart.createBufferedImage( ingo@297: width, height, Transparency.BITMASK, null); ingo@297: } ingo@297: ingo@297: public void exportSVG() { ingo@297: log.info("export chart as svg (not implemented yet)"); ingo@297: } ingo@297: ingo@297: public void exportPDF() { ingo@297: log.info("export chart as pdf (not implemented yet)"); ingo@297: } ingo@297: } ingo@297: // vim:set ts=4 sw=4 si et sta sts=4 fenc=latin1 :