Mercurial > dive4elements > gnv-client
annotate gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java @ 372:c8a313165bd5
Fixed typo
gnv-artifacts/trunk@454 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 17 Dec 2009 16:08:37 +0000 |
parents | 061355435075 |
children | 04a242c67fe6 |
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(); |
364
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
59 this.ranges = new HashMap(); |
298
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 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 protected void initData() { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 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
|
65 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 String breakPoint1 = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 String breakPoint2 = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 String breakPoint3 = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 Iterator iter = resultSet.iterator(); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 Result row = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 String seriesName = null; |
364
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
73 String parameter = null; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 XYSeries series = null; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 |
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
|
76 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
|
77 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
|
78 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
|
79 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
|
80 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
|
81 |
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
|
82 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
|
83 (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
|
84 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 while (iter.hasNext()) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 row = (Result) iter.next(); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 // 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
|
89 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
|
90 !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
|
91 !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
|
92 ) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 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
|
94 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 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
|
96 gapDetection(results, series, startPos, endPos); |
364
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
97 addSeries(series, parameter, 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
|
98 |
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
|
99 startPos = endPos +1; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 // 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
|
103 breakPoint1 = row.getString("GROUP1"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 breakPoint2 = row.getString("GROUP2"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 breakPoint3 = row.getString("GROUP3"); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 seriesName = createSeriesName( |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 breakPoint1, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 breakPoint2, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 breakPoint3 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 ); |
364
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
112 parameter = findParameter(seriesName); |
298
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 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
|
115 series = new XYSeries(seriesName); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 } |
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 addValue(row, series); |
364
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
119 storeMaxRange(row.getDouble("YORDINATE"), parameter); |
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
|
120 endPos++; |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 |
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
|
123 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
|
124 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
|
125 |
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
|
126 gapDetection(results, series, startPos, endPos); |
364
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
127 addSeries(series, parameter, idx); |
310
45625b5cd6d4
Added timegap definitions to charts. Adapted constructors and constructor calls.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
301
diff
changeset
|
128 |
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
|
129 addDatasets(); |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 |
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
|
133 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
|
134 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
|
135 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
|
136 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
|
137 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
|
138 ) { |
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 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
|
140 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
|
141 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
|
142 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
|
143 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
|
144 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
|
145 } |
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
|
146 |
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
|
147 |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
148 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
|
149 ((XYSeries) series).add( |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
150 row.getDouble("XORDINATE"), |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
151 row.getDouble("YORDINATE") |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
152 ); |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
153 } |
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 |
364
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
156 protected void addSeries(Series series, String parameter, int idx) { |
2413273f1c13
Workarround: Store lower and upper bounds of data while iterating over all data and set the max range of axes with these information. JFreeCharts method NumberAxis.setAutoRange(true) doesn't seem to work properly.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
340
diff
changeset
|
157 log.debug("add series (" + parameter + ")to chart"); |
298
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 if (series == null) { |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
160 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
|
161 return; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
162 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
163 |
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
|
164 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
|
165 |
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 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
|
167 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
|
168 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
|
169 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
|
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 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
|
172 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
|
173 } |
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 |
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 |
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 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
|
177 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
|
178 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
|
179 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
|
180 |
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 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
|
182 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
|
183 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
|
184 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
|
185 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
|
186 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
|
187 |
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 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
|
189 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
|
190 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
|
191 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
|
192 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
|
193 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
|
194 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
|
195 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
|
196 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
|
197 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
|
198 ); |
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
|
199 } |
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
|
200 } |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 } |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 |
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
|
204 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
|
205 // 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
|
206 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
|
207 } |
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
|
208 |
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
|
209 |
298
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 protected String createSeriesName( |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
211 String breakPoint1, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 String breakPoint2, |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 String breakPoint3 |
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 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
|
216 return findValueTitle(parameters, breakPoint1) + |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 " " + |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 findValueTitle(measurements, breakPoint2) + |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 "m"; |
80f7c5dc09c6
Implementation of classes for creating timeseries, verticalprofile and horizontalprofile charts.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 } |
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
|
221 |
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 |
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 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
|
224 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
|
225 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
|
226 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
|
227 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
|
228 ) { |
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 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
|
230 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
|
231 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
|
232 ); |
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 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
|
234 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
|
235 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
|
236 |
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 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
|
238 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
|
239 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
|
240 |
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 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
|
242 |
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 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
|
244 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
|
245 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
|
246 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
|
247 ((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
|
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 } |
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 |
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 |
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 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
|
254 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
|
255 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
|
256 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
|
257 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
|
258 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
|
259 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
|
260 ) { |
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 |
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 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
|
263 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
|
264 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
|
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 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
|
267 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
|
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 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
|
270 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
|
271 |
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 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
|
273 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
|
274 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
|
275 // 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
|
276 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
|
277 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
|
278 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
|
279 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
|
280 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
|
281 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
|
282 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
|
283 ); |
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 |
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 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
|
286 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
|
287 ((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
|
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 } |
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 |
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 |
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 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
|
294 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
|
295 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
|
296 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
|
297 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
|
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 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
|
300 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
|
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 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
|
303 } |
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 |
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 |
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 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
|
307 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
|
308 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
|
309 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
|
310 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
|
311 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
|
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 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
|
314 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
|
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 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
|
317 } |
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 |
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 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
|
321 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
|
322 } |
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 |
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 |
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 protected String getDependendAxisName(Result first, Result second) { |
370
061355435075
Changed depending value for gap detection in verticalprofile charts on meshes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
364
diff
changeset
|
326 return "KPOSITION"; |
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
|
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 : |