Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeLongitudinalSectionInfoGenerator.java @ 647:bb484489d3df
Introduced a new output generators for creating chart info documents.
flys-artifacts/trunk@2032 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 01 Jun 2011 08:01:07 +0000 |
parents | |
children | 67c7020f4ed3 |
comparison
equal
deleted
inserted
replaced
646:d299e220d89c | 647:bb484489d3df |
---|---|
1 package de.intevation.flys.exports; | |
2 | |
3 import java.awt.Color; | |
4 | |
5 import org.apache.log4j.Logger; | |
6 | |
7 import org.jfree.chart.ChartFactory; | |
8 import org.jfree.chart.JFreeChart; | |
9 import org.jfree.chart.plot.PlotOrientation; | |
10 import org.jfree.chart.plot.XYPlot; | |
11 | |
12 /** | |
13 * A ChartInfoGenerator that generates meta information for specific discharge | |
14 * longitudinal section curves. | |
15 * | |
16 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
17 */ | |
18 public class DischargeLongitudinalSectionInfoGenerator | |
19 extends ChartInfoGenerator | |
20 { | |
21 private static Logger logger = | |
22 Logger.getLogger(DischargeLongitudinalSectionInfoGenerator.class); | |
23 | |
24 | |
25 public DischargeLongitudinalSectionInfoGenerator() { | |
26 super(new DischargeLongitudinalSectionGenerator()); | |
27 } | |
28 | |
29 | |
30 protected int[] getSize() { | |
31 DischargeLongitudinalSectionGenerator gen = | |
32 (DischargeLongitudinalSectionGenerator) generator; | |
33 | |
34 return gen.getSize(); | |
35 } | |
36 | |
37 | |
38 /** | |
39 * Creates a chart object. | |
40 * | |
41 * @return a chart object. | |
42 */ | |
43 protected JFreeChart generateChart() { | |
44 logger.debug("DischargeCurveInfoGenerator.generateChart"); | |
45 | |
46 DischargeLongitudinalSectionGenerator gen = | |
47 (DischargeLongitudinalSectionGenerator) generator; | |
48 | |
49 JFreeChart chart = ChartFactory.createXYLineChart( | |
50 gen.getChartTitle(), | |
51 gen.getXAxisLabel(), | |
52 gen.getYAxisLabel(), | |
53 null, | |
54 PlotOrientation.VERTICAL, | |
55 true, | |
56 false, | |
57 false); | |
58 | |
59 chart.setBackgroundPaint(Color.WHITE); | |
60 chart.getPlot().setBackgroundPaint(Color.WHITE); | |
61 | |
62 XYPlot plot = (XYPlot) chart.getPlot(); | |
63 | |
64 gen.addDatasets(chart); | |
65 gen.addSubtitles(chart); | |
66 gen.adjustPlot(plot); | |
67 gen.adjustAxes(plot); | |
68 | |
69 return chart; | |
70 } | |
71 } | |
72 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |