annotate gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractChart.java @ 301:3ea030aafe65

Removed duplicated and needless imports. gnv-artifacts/trunk@355 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 20 Nov 2009 14:03:31 +0000
parents 3f43392df3f6
children 9ba2cf8cad8d
rev   line source
297
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.gnv.chart;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import java.util.Collection;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 import java.util.Locale;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 import java.awt.Transparency;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 import java.awt.image.BufferedImage;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import org.apache.log4j.Logger;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import org.jfree.chart.JFreeChart;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import org.jfree.chart.ChartTheme;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 /**
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 * @author Ingo Weinzierl <ingo.weinzierl@intevation.de>
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 */
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 public abstract class AbstractChart
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 implements Chart
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 {
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 private static Logger log = Logger.getLogger(AbstractChart.class);
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21 protected JFreeChart chart;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 protected Locale locale;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 protected ChartLabels labels;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 protected ChartTheme theme;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 protected Collection parameters;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 protected Collection measurements;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 protected Collection resultSet;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 protected Collection dates;
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 public abstract JFreeChart generateChart();
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 public BufferedImage exportPNG(int width, int height) {
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 log.info("export chart as png");
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 return chart.createBufferedImage(
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 width, height, Transparency.BITMASK, null);
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 }
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 public void exportSVG() {
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 log.info("export chart as svg (not implemented yet)");
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 }
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 public void exportPDF() {
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 log.info("export chart as pdf (not implemented yet)");
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 }
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 }
3f43392df3f6 Interface and abstract classes for chart creation implemented.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 // vim:set ts=4 sw=4 si et sta sts=4 fenc=latin1 :

http://dive4elements.wald.intevation.org