Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java @ 348:635af5381a4d
Added an abstract OutGenerator that should be the base class for all generators which create charts.
flys-artifacts/trunk@1750 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 27 Apr 2011 14:40:44 +0000 |
parents | 8940b0885865 |
children | 8830eecad69e |
comparison
equal
deleted
inserted
replaced
347:a63d8bdb2d79 | 348:635af5381a4d |
---|---|
1 package de.intevation.flys.exports; | 1 package de.intevation.flys.exports; |
2 | 2 |
3 import java.awt.Color; | 3 import java.awt.Color; |
4 import java.io.IOException; | 4 import java.io.IOException; |
5 import java.io.OutputStream; | |
6 import java.util.ArrayList; | 5 import java.util.ArrayList; |
7 import java.util.List; | 6 import java.util.List; |
8 import java.util.Map; | 7 import java.util.Map; |
9 | 8 |
10 import org.apache.log4j.Logger; | 9 import org.apache.log4j.Logger; |
16 import org.jfree.chart.ChartFactory; | 15 import org.jfree.chart.ChartFactory; |
17 import org.jfree.chart.JFreeChart; | 16 import org.jfree.chart.JFreeChart; |
18 import org.jfree.chart.plot.PlotOrientation; | 17 import org.jfree.chart.plot.PlotOrientation; |
19 | 18 |
20 import de.intevation.artifacts.Artifact; | 19 import de.intevation.artifacts.Artifact; |
21 import de.intevation.artifacts.CallContext; | |
22 | 20 |
23 import de.intevation.flys.model.Gauge; | 21 import de.intevation.flys.model.Gauge; |
24 | 22 |
25 import de.intevation.flys.artifacts.FLYSArtifact; | 23 import de.intevation.flys.artifacts.FLYSArtifact; |
26 import de.intevation.flys.artifacts.model.DischargeTables; | 24 import de.intevation.flys.artifacts.model.DischargeTables; |
31 /** | 29 /** |
32 * An OutGenerator that generates discharge curves. | 30 * An OutGenerator that generates discharge curves. |
33 * | 31 * |
34 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 32 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
35 */ | 33 */ |
36 public class DischargeCurveGenerator implements OutGenerator { | 34 public class DischargeCurveGenerator extends ChartGenerator { |
37 | 35 |
38 /** The logger used in this generator.*/ | 36 /** The logger used in this generator.*/ |
39 private static Logger logger = | 37 private static Logger logger = |
40 Logger.getLogger(DischargeCurveGenerator.class); | 38 Logger.getLogger(DischargeCurveGenerator.class); |
41 | 39 |
42 /** The document of the incoming out() request.*/ | |
43 protected Document request; | |
44 | |
45 /** The output stream where the data should be written to.*/ | |
46 protected OutputStream out; | |
47 | |
48 /** The CallContext object.*/ | |
49 protected CallContext context; | |
50 | 40 |
51 /** The Dataset that contains the data for the chart.*/ | 41 /** The Dataset that contains the data for the chart.*/ |
52 protected DefaultXYDataset dataset; | 42 protected DefaultXYDataset dataset; |
53 | 43 |
54 | 44 |
55 public DischargeCurveGenerator() { | 45 public DischargeCurveGenerator() { |
56 } | 46 super(); |
57 | |
58 | |
59 public void init(Document request, OutputStream out, CallContext context) { | |
60 logger.debug("DischargeCurveGenerator.init"); | |
61 | |
62 this.request = request; | |
63 this.out = out; | |
64 this.context = context; | |
65 | 47 |
66 this.dataset = new DefaultXYDataset(); | 48 this.dataset = new DefaultXYDataset(); |
67 } | 49 } |
68 | 50 |
69 | 51 |