Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java @ 352:24c21a720aa5
Added Support for "horizontale Schnittprofile"
gnv-artifacts/trunk@425 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Tue, 15 Dec 2009 10:20:16 +0000 |
parents | 07a64cfafdf1 |
children | 2413273f1c13 |
rev | line source |
---|---|
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.gnv.chart; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import java.util.Collection; |
334
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
4 import java.util.HashMap; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import java.util.Iterator; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import java.util.Locale; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 import org.apache.log4j.Logger; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import org.jfree.chart.ChartTheme; |
315
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
11 import org.jfree.chart.axis.Axis; |
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
12 import org.jfree.chart.plot.XYPlot; |
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
13 import org.jfree.chart.plot.PlotOrientation; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import org.jfree.data.xy.XYSeries; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import org.jfree.data.general.Series; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 import org.jfree.data.xy.XYSeriesCollection; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.gnv.geobackend.base.Result; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
334
diff
changeset
|
19 import de.intevation.gnv.state.describedata.KeyValueDescibeData; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 /** |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 * @author Ingo Weinzierl <ingo.weinzierl@intevation.de> |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 */ |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 public class VerticalProfileChart |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 extends AbstractXYLineChart |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 private static Logger log = Logger.getLogger(VerticalProfileChart.class); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
30 protected final double PERCENTAGE = 5.0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
31 protected final double GAP_MAX_LEVEL = Math.sqrt(2.0); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
32 protected final int GAP_MAX_VALUES = 60; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
33 |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 public VerticalProfileChart( |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 ChartLabels labels, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 ChartTheme theme, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 Collection parameters, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 Collection measurements, |
310
45625b5cd6d4
Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
301
diff
changeset
|
40 Collection dates, |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 Collection result, |
310
45625b5cd6d4
Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
301
diff
changeset
|
42 Collection timeGaps, |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
315
diff
changeset
|
43 Locale locale, |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
315
diff
changeset
|
44 boolean linesVisible, |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
315
diff
changeset
|
45 boolean shapesVisible |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 ) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 this.labels = labels; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 this.theme = theme; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 this.parameters = parameters; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 this.measurements = measurements; |
310
45625b5cd6d4
Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
301
diff
changeset
|
51 this.dates = dates; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 this.resultSet = result; |
310
45625b5cd6d4
Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
301
diff
changeset
|
53 this.timeGaps = timeGaps; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 this.locale = locale; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 this.PLOT_ORIENTATION = PlotOrientation.HORIZONTAL; |
327
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
315
diff
changeset
|
56 this.linesVisible = linesVisible; |
22a6493e8460
New options in chart template: visibility of lines and points in charts and point's size.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
315
diff
changeset
|
57 this.shapesVisible = shapesVisible; |
334
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
58 this.datasets = new HashMap(); |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 protected void initData() { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 log.debug("init data for VerticalProfileChart"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 String breakPoint1 = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 String breakPoint2 = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 String breakPoint3 = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 Iterator iter = resultSet.iterator(); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 Result row = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 String seriesName = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 XYSeries series = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
74 int idx = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
75 int startPos = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
76 int endPos = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
77 double startValue = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
78 double endValue = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
79 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
80 Result[] results = |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
81 (Result[]) resultSet.toArray(new Result[resultSet.size()]); |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 while (iter.hasNext()) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 row = (Result) iter.next(); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 // add current data to plot and prepare for next one |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 if (!row.getString("GROUP1").equals(breakPoint1) || |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 !row.getString("GROUP2").equals(breakPoint2) || |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 !row.getString("GROUP3").equals(breakPoint3) |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 ) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 log.debug("prepare data/plot for next dataset"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 if(series != null) { |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
94 gapDetection(results, series, startPos, endPos); |
334
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
95 addSeries(series, seriesName, idx); |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
96 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
97 startPos = endPos +1; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 // prepare variables for next plot |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 breakPoint1 = row.getString("GROUP1"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 breakPoint2 = row.getString("GROUP2"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 breakPoint3 = row.getString("GROUP3"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 seriesName = createSeriesName( |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 breakPoint1, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 breakPoint2, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 breakPoint3 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 ); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 log.debug("next dataset is '" + seriesName + "'"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 series = new XYSeries(seriesName); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 addValue(row, series); |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
116 endPos++; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
119 if (results.length == 0) |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
120 return; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
121 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
122 gapDetection(results, series, startPos, endPos); |
334
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
123 addSeries(series, seriesName, idx); |
310
45625b5cd6d4
Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
301
diff
changeset
|
124 |
334
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
125 addDatasets(); |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
129 protected void gapDetection( |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
130 Result[] results, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
131 Series series, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
132 int startPos, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
133 int endPos |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
134 ) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
135 double startValue = results[startPos].getDouble("XORDINATE"); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
136 double endValue = results[endPos-1].getDouble("XORDINATE"); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
137 if (results[0].getInteger("DATAID") == 2) |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
138 addGapsOnGrid(results, series, startPos, endPos); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
139 else |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
140 addGaps(results, series, startValue, endValue, startPos, endPos); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
141 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
142 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
143 |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 protected void addValue(Result row, Series series) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
145 ((XYSeries) series).add( |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 row.getDouble("XORDINATE"), |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 row.getDouble("YORDINATE") |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 ); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
149 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 |
334
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
152 protected void addSeries(Series series, String label, int idx) { |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
153 log.debug("add series (" + label + ")to chart"); |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
154 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
155 if (series == null) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
156 log.warn("no data to add"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 return; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
158 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
159 |
334
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
160 XYSeriesCollection xysc = null; |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
161 String parameter = findParameter(label); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
162 |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
163 if (datasets.containsKey(parameter)) |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
164 xysc = (XYSeriesCollection) datasets.get(parameter); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
165 else |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
166 xysc = new XYSeriesCollection(); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
167 |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
168 xysc.addSeries((XYSeries) series); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
169 datasets.put(parameter, xysc); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
170 } |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
171 |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
172 |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
173 protected void addDatasets() { |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
174 Iterator iter = parameters.iterator(); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
175 XYPlot plot = chart.getXYPlot(); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
176 int idx = 0; |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
177 |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
178 XYSeriesCollection xysc = null; |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
179 KeyValueDescibeData data = null; |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
180 String key = null; |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
181 while (iter.hasNext()) { |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
182 data = (KeyValueDescibeData) iter.next(); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
183 key = data.getValue(); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
184 |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
185 if (datasets.containsKey(key)) { |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
186 xysc = (XYSeriesCollection)datasets.get(key); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
187 plot.setDataset(idx, xysc ); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
188 log.debug("Added " + key + " parameter to plot."); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
189 prepareAxis(key, idx); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
190 adjustRenderer( |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
191 idx++, |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
192 xysc.getSeriesCount(), |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
193 linesVisible, |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
194 shapesVisible |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
195 ); |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
196 } |
e37930705daa
Changed the way of adding data to charts. Same parameters have one axis - not each parameter its own one.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
327
diff
changeset
|
197 } |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 |
315
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
201 protected void localizeDomainAxis(Axis axis, Locale locale) { |
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
202 // call localizeRangeAxis from superclass which formats NumberAxis |
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
203 super.localizeRangeAxis(axis, locale); |
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
204 } |
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
205 |
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
206 |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 protected String createSeriesName( |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 String breakPoint1, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 String breakPoint2, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 String breakPoint3 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 ) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 log.debug("create seriesname of verticalprofile chart"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 return findValueTitle(parameters, breakPoint1) + |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
214 " " + |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 findValueTitle(measurements, breakPoint2) + |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
216 "m"; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 } |
340
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
218 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
219 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
220 protected void addGapsOnGrid( |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
221 Result[] results, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
222 Series series, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
223 int startPos, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
224 int endPos |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
225 ) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
226 String axis = getDependendAxisName( |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
227 results[startPos], |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
228 results[startPos+1] |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
229 ); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
230 double range = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
231 int last = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
232 int current = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
233 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
234 for (int i = startPos+1; i < endPos; i++) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
235 last = results[i-1].getInteger(axis); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
236 current = results[i].getInteger(axis); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
237 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
238 boolean detected = gridDetection(last, current); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
239 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
240 if (detected) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
241 double xOld = results[i-1].getDouble("XORDINATE"); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
242 double xNow = results[i].getDouble("XORDINATE"); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
243 log.debug("Gap detected on grid between "+ xOld +" and "+ xNow); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
244 ((XYSeries) series).add(xOld+0.0001, null); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
245 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
246 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
247 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
248 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
249 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
250 protected void addGaps( |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
251 Result[] results, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
252 Series series, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
253 double startValue, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
254 double endValue, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
255 int startPos, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
256 int endPos |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
257 ) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
258 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
259 double last = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
260 double current = 0; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
261 int num = results.length; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
262 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
263 for (int i = startPos+1; i < endPos; i++) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
264 boolean detected = false; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
265 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
266 last = results[i-1].getDouble("YORDINATE"); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
267 current = results[i].getDouble("YORDINATE"); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
268 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
269 // gap detection for more than GAP_MAX_VALUES values |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
270 if (num > GAP_MAX_VALUES) |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
271 detected = simpleDetection(startValue, endValue, last, current); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
272 // gap detection for less than GAP_MAX_VALUES values |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
273 else |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
274 detected = specialDetection( |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
275 startValue, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
276 endValue, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
277 last, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
278 current, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
279 num |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
280 ); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
281 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
282 if (detected) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
283 log.info("Gap between " + last + " and " + current); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
284 ((XYSeries) series).add((last+current)/2, null); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
285 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
286 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
287 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
288 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
289 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
290 protected boolean simpleDetection( |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
291 double start, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
292 double end, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
293 double last, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
294 double current |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
295 ) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
296 double delta = Math.abs(end - start); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
297 double smallDelta = Math.abs(current - last); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
298 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
299 return (smallDelta > delta / 100 * PERCENTAGE); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
300 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
301 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
302 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
303 protected boolean specialDetection( |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
304 double start, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
305 double end, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
306 double last, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
307 double current, |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
308 int count |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
309 ) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
310 double delta = Math.abs(end - start); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
311 double smallDelta = Math.abs(current - last); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
312 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
313 return (smallDelta > (3.0 / (count - 1) * delta)); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
314 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
315 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
316 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
317 protected boolean gridDetection(double last, double current) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
318 return (Math.abs(current - last) > GAP_MAX_LEVEL); |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
319 } |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
320 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
321 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
322 protected String getDependendAxisName(Result first, Result second) { |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
323 if (first.getInteger("IPOSITION") == second.getInteger("IPOSITION")) |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
324 return "JPOSITION"; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
325 |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
326 return "IPOSITION"; |
07a64cfafdf1
Added gap detection in horizontal and vertical profile charts. Distinguish between meshes and other data sources.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
327 } |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
328 } |
315
63f8b3fb7d9a
Localization of chart axis with locale which fits best to server and browser settings.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
310
diff
changeset
|
329 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |