Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/DischargeGenerator.java @ 9726:0a5239a1e46e 3.2.x
Upgrade to Log4j 2
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Wed, 02 Mar 2022 10:26:50 +0100 |
parents | e6d0fc817e20 |
children |
rev | line source |
---|---|
8165
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2014 by Bundesanstalt für Gewässerkunde |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 * |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 */ |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 package org.dive4elements.river.exports; |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
10 import java.awt.Font; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
11 |
9726 | 12 import org.apache.logging.log4j.Logger; |
13 import org.apache.logging.log4j.LogManager; | |
8353
a82f24b773e7
Use i18n string for w in cm axis.
Raimund Renkert <rrenkert@intevation.de>
parents:
8338
diff
changeset
|
14 import org.dive4elements.river.artifacts.resources.Resources; |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
15 import org.dive4elements.river.exports.injector.InjectorConstants; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
16 import org.dive4elements.river.jfree.AxisDataset; |
8338
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
17 import org.dive4elements.river.jfree.DoubleBounds; |
8738
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
18 |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
19 import org.jfree.chart.axis.NumberAxis; |
8738
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
20 import org.jfree.chart.axis.ValueAxis; |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
21 import org.jfree.chart.plot.XYPlot; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
22 import org.jfree.data.Range; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
23 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
24 public class DischargeGenerator |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
25 extends DiagramGenerator |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
26 implements InjectorConstants |
8165
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
27 { |
9726 | 28 private static Logger log = LogManager.getLogger(DischargeGenerator.class); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
29 |
8353
a82f24b773e7
Use i18n string for w in cm axis.
Raimund Renkert <rrenkert@intevation.de>
parents:
8338
diff
changeset
|
30 private String I18N_AXIS_LABEL = "chart.discharge.curve.yaxis.cm.label"; |
a82f24b773e7
Use i18n string for w in cm axis.
Raimund Renkert <rrenkert@intevation.de>
parents:
8338
diff
changeset
|
31 |
8571
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
32 private int wAxisIndex; |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
33 private int wInCmAxisIndex; |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
34 double pnpValue; |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
35 |
8165
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
36 public DischargeGenerator() { |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
37 } |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
38 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
39 @Override |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
40 public void addDatasets(XYPlot plot) { |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
41 super.addDatasets(plot); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
42 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
43 Object pnp = context.getContextValue(PNP); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
44 if (!(pnp instanceof Number)) { |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
45 return; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
46 } |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
47 |
8571
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
48 pnpValue = ((Number)pnp).doubleValue(); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
49 |
8571
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
50 wAxisIndex = diagramAttributes.getAxisIndex("W"); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
51 if (wAxisIndex == -1) { |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
52 log.warn("No W axis found."); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
53 return; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
54 } |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
55 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
56 AxisDataset data = datasets.get(wAxisIndex); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
57 if (data == null) { |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
58 // No W axis |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
59 return; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
60 } |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
61 |
8330
e87a993c6611
Avoid NPE if no dataset is activated in theme list.
"Tom Gottfried <tom@intevation.de>"
parents:
8324
diff
changeset
|
62 if (data.getRange() == null) { |
e87a993c6611
Avoid NPE if no dataset is activated in theme list.
"Tom Gottfried <tom@intevation.de>"
parents:
8324
diff
changeset
|
63 // No active datasets |
e87a993c6611
Avoid NPE if no dataset is activated in theme list.
"Tom Gottfried <tom@intevation.de>"
parents:
8324
diff
changeset
|
64 return; |
e87a993c6611
Avoid NPE if no dataset is activated in theme list.
"Tom Gottfried <tom@intevation.de>"
parents:
8324
diff
changeset
|
65 } |
e87a993c6611
Avoid NPE if no dataset is activated in theme list.
"Tom Gottfried <tom@intevation.de>"
parents:
8324
diff
changeset
|
66 |
8338
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
67 Range axisRange = inCm( |
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
68 plot.getRangeAxis(wAxisIndex).getRange(), |
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
69 pnpValue |
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
70 ); |
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
71 Range dataRange = inCm(data.getRange(), pnpValue); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
72 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
73 // Do we have an index for W in cm? |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
74 NumberAxis wInCmAxis = createWinCMAxis(wAxisIndex); |
8338
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
75 wInCmAxis.setRange(axisRange); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
76 |
8571
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
77 wInCmAxisIndex = plot.getRangeAxisCount(); |
8338
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
78 plot.setRangeAxis(wInCmAxisIndex, wInCmAxis); |
ac7cb15e1946
Scale second W-axis in cm according to first axis, which is expanded relative to the data, and set bounds for zooming purposes (plus a bit of cleanup in DiagramGenerator).
"Tom Gottfried <tom@intevation.de>"
parents:
8330
diff
changeset
|
79 combineYBounds(new DoubleBounds(dataRange), wInCmAxisIndex); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
80 } |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
81 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
82 private static Range inCm(Range r, double pnpValue) { |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
83 double l = r.getLowerBound(); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
84 double u = r.getUpperBound(); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
85 l = (l - pnpValue)*100d; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
86 u = (u - pnpValue)*100d; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
87 return new Range(l, u); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
88 } |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
89 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
90 private NumberAxis createWinCMAxis(int wAxisIndex) { |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
91 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
92 Font labelFont = new Font( |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
93 DEFAULT_FONT_NAME, |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
94 Font.BOLD, |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
95 getYAxisFontSize(wAxisIndex)); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
96 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
97 String axisName = "W.in.cm"; |
8353
a82f24b773e7
Use i18n string for w in cm axis.
Raimund Renkert <rrenkert@intevation.de>
parents:
8338
diff
changeset
|
98 String axisLabel = Resources.getMsg(context.getMeta(), |
a82f24b773e7
Use i18n string for w in cm axis.
Raimund Renkert <rrenkert@intevation.de>
parents:
8338
diff
changeset
|
99 I18N_AXIS_LABEL, "W [cm]"); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
100 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
101 IdentifiableNumberAxis axis = new IdentifiableNumberAxis( |
8353
a82f24b773e7
Use i18n string for w in cm axis.
Raimund Renkert <rrenkert@intevation.de>
parents:
8338
diff
changeset
|
102 axisName, axisLabel); |
8320
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
103 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
104 axis.setAutoRangeIncludesZero(false); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
105 axis.setLabelFont(labelFont); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
106 axis.setTickLabelFont(labelFont); |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
107 |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
108 return axis; |
b1303070c050
Generate a W in CM axis if there are W data.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
8165
diff
changeset
|
109 } |
8571
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
110 |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
111 /** We need to override this to keep both axis synced. */ |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
112 @Override |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
113 protected void autoZoom(XYPlot plot) { |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
114 super.autoZoom(plot); |
8738
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
115 |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
116 ValueAxis wAxis = plot.getRangeAxis(wAxisIndex); |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
117 if (wAxis instanceof IdentifiableNumberAxis) { |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
118 IdentifiableNumberAxis idA = (IdentifiableNumberAxis)wAxis; |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
119 Range fixedRange = getRangeForAxisFromSettings(idA.getId()); |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
120 if (fixedRange == null) { |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
121 return; |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
122 } |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
123 |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
124 log.debug("Adjusting helper centimeter axis to fixed range."); |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
125 Range adjustedRange = inCm( |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
126 fixedRange, |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
127 pnpValue |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
128 ); |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
129 IdentifiableNumberAxis wInCmAxis= |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
130 (IdentifiableNumberAxis) plot.getRangeAxis(wInCmAxisIndex); |
e6d0fc817e20
(issue1798) Handle the case when there are no data in the diagram.
Tom Gottfried <tom@intevation.de>
parents:
8571
diff
changeset
|
131 wInCmAxis.setRange(adjustedRange); |
8571
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
132 } |
bc803f4b6784
(issue1798) Adjust WinCM according to W in NHN axis on explicit zoom
Andre Heinecke <andre.heinecke@intevation.de>
parents:
8353
diff
changeset
|
133 } |
8165
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
134 } |
cfb3a4d0c637
Added new diagramm generator for Q symmetry.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
135 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |