Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/TimeseriesChartGenerator.java @ 2242:7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
flys-artifacts/trunk@3890 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 03 Feb 2012 09:39:22 +0000 |
parents | 23c7c51df772 |
children | 6aeb71517136 |
rev | line source |
---|---|
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
3 import java.awt.Color; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
4 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
5 import java.util.ArrayList; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
6 import java.util.HashMap; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
7 import java.util.List; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
8 import java.util.Map; |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import org.apache.log4j.Logger; |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
12 import org.jfree.chart.ChartFactory; |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 import org.jfree.chart.JFreeChart; |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
14 import org.jfree.chart.plot.XYPlot; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
15 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
16 import org.jfree.data.Range; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
17 import org.jfree.data.time.TimeSeriesCollection; |
2242
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
18 import org.jfree.data.general.Series; |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
19 import org.jfree.data.xy.XYDataset; |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 /** |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 */ |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 public abstract class TimeseriesChartGenerator extends ChartGenerator { |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
27 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
28 /** |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
29 * Inner class TimeseriesAxisDataset stores TimeSeriesCollection. |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
30 */ |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
31 public class TimeseriesAxisDataset implements AxisDataset { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
32 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
33 protected int axisSymbol; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
34 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
35 protected List<TimeSeriesCollection> datasets; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
36 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
37 protected Range range; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
38 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
39 protected int plotAxisIndex; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
40 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
41 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
42 public TimeseriesAxisDataset(int axisSymbol) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
43 this.axisSymbol = axisSymbol; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
44 this.datasets = new ArrayList<TimeSeriesCollection>(); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
45 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
46 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
47 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
48 @Override |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
49 public void addDataset(XYDataset dataset) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
50 if (!(dataset instanceof TimeSeriesCollection)) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
51 logger.warn("Skip non TimeSeriesCollection dataset."); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
52 return; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
53 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
54 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
55 TimeSeriesCollection tsc = (TimeSeriesCollection) dataset; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
56 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
57 datasets.add(tsc); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
58 mergeRanges(tsc); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
59 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
60 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
61 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
62 @Override |
2242
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
63 public XYDataset[] getDatasets() { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
64 return (XYDataset[]) |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
65 datasets.toArray(new XYDataset[datasets.size()]); |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
66 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
67 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
68 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
69 @Override |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
70 public boolean isEmpty() { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
71 return datasets.isEmpty(); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
72 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
73 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
74 |
2242
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
75 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
76 public void setRange(Range range) { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
77 this.range = range; |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
78 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
79 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
80 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
81 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
82 public Range getRange() { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
83 return range; |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
84 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
85 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
86 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
87 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
88 public void setPlotAxisIndex(int plotAxisIndex) { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
89 this.plotAxisIndex = plotAxisIndex; |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
90 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
91 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
92 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
93 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
94 public int getPlotAxisIndex() { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
95 return plotAxisIndex; |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
96 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
97 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
98 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
99 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
100 public boolean isArea(XYDataset dataset) { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
101 logger.warn("This AxisDataset doesn't support Areas yet!"); |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
102 return false; |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
103 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
104 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
105 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
106 protected void mergeRanges(TimeSeriesCollection dataset) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
107 logger.debug("Range after merging: " + range); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
108 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
109 Range[] xyRanges = ChartHelper.getRanges(dataset); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
110 range = Range.combine(range, xyRanges[1]); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
111 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
112 logger.debug("Range after merging: " + range); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
113 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
114 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
115 } // end of TimeseriesAxisDataset class |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
116 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
117 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
118 |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 private static final Logger logger = |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 Logger.getLogger(TimeseriesChartGenerator.class); |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
123 protected Map<Integer, Range> xRanges; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
124 |
2242
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
125 protected Map<Integer, Range> yRanges; |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
126 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
127 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
128 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
129 /** |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
130 * The default constructor that initializes internal datastructures. |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
131 */ |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
132 public TimeseriesChartGenerator() { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
133 super(); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
134 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
135 xRanges = new HashMap<Integer, Range>(); |
2242
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
136 yRanges = new HashMap<Integer, Range>(); |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
137 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
138 |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
139 |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
140 |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
141 @Override |
2234
46ec09c7f578
Refactoring: moved more base code from XYChartGenerator into its parent class ChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
142 public JFreeChart generateChart() { |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 logger.info("Generate Timeseries Chart."); |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
145 JFreeChart chart = ChartFactory.createTimeSeriesChart( |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
146 getChartTitle(), |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
147 getXAxisLabel(), |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
148 getYAxisLabel(0), |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
149 null, |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
150 true, |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
151 false, |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
152 false); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
153 |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 logger.warn("TODO: IMPLEMENT ME!"); |
2234
46ec09c7f578
Refactoring: moved more base code from XYChartGenerator into its parent class ChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2233
diff
changeset
|
155 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
156 XYPlot plot = (XYPlot) chart.getPlot(); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
157 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
158 chart.setBackgroundPaint(Color.WHITE); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
159 plot.setBackgroundPaint(Color.WHITE); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
160 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
161 addSubtitles(chart); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
162 addDatasets(plot); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
163 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
164 return chart; |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
165 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
166 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
167 |
2242
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
168 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
169 protected Series getSeriesOf(XYDataset dataset, int idx) { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
170 return ((TimeSeriesCollection) dataset).getSeries(idx); |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
171 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
172 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
173 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
174 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
175 protected void setXRange(int axis, Range range) { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
176 xRanges.put(Integer.valueOf(axis), range); |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
177 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
178 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
179 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
180 @Override |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
181 protected void setYRange(int axis, Range range) { |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
182 yRanges.put(Integer.valueOf(axis), range); |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
183 } |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
184 |
7e8e1d5384c0
Further refactoring of XYChartGenerator / ChartGenerator with the result, that timerange charts are now able to display lines.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2238
diff
changeset
|
185 |
2238
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
186 /** |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
187 * This method creates new instances of TimeseriesAxisDataset. |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
188 * |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
189 * @param idx The symbol for the new TimeseriesAxisDataset. |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
190 */ |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
191 @Override |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
192 protected AxisDataset createAxisDataset(int idx) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
193 logger.debug("Create a new AxisDataset for index: " + idx); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
194 return new TimeseriesAxisDataset(idx); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
195 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
196 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
197 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
198 /** |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
199 * Effect: extend range of x axis to include given limits. |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
200 * @param range the given ("minimal") range. |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
201 * @param index index of axis to be merged. |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
202 */ |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
203 @Override |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
204 protected void combineXRanges(Range range, int index) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
205 if (range != null) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
206 Range old = xRanges.get(index); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
207 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
208 if (old != null) { |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
209 range = Range.combine(old, range); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
210 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
211 |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
212 xRanges.put(index, range); |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
213 } |
23c7c51df772
Some more refactoring in XYChartGenerator and ChartGenerator; implemented necessary stuff in TimeseriesChartGenerator and return new empty instances of timeseries charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2236
diff
changeset
|
214 } |
2233
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 } |
958a10e2e246
Added a new ChartGenerator for timeseries charts and refactored some code in XYChartGenerator.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |