Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 0beb34d55630 |
children | 1cc7653ca84f 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
70 | 70 |
71 public static final String I18N_YAXIS_LABEL_DEFAULT = | 71 public static final String I18N_YAXIS_LABEL_DEFAULT = |
72 "W [NN + m]"; | 72 "W [NN + m]"; |
73 | 73 |
74 | 74 |
75 /** First, ask parent to add data, then handle extreme_wq_curve(_base) data.*/ | 75 /** First, ask parent to add data, then handle extreme_wq_curve(_base) |
76 @Override | 76 * data.*/ |
77 public boolean prepareChartData(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { | 77 @Override |
78 public boolean prepareChartData( | |
79 ArtifactAndFacet aaf, | |
80 ThemeDocument theme, | |
81 boolean visible | |
82 ) { | |
78 if (super.prepareChartData(aaf, theme, visible)) { | 83 if (super.prepareChartData(aaf, theme, visible)) { |
79 return true; | 84 return true; |
80 } | 85 } |
81 | 86 |
82 String name = aaf.getFacetName(); | 87 String name = aaf.getFacetName(); |
100 plot.setRangeAxis(1, createYAxis(YAXIS.W.idx)); | 105 plot.setRangeAxis(1, createYAxis(YAXIS.W.idx)); |
101 } | 106 } |
102 } | 107 } |
103 | 108 |
104 /** Do Extreme Curve nonextrapolated points out. */ | 109 /** Do Extreme Curve nonextrapolated points out. */ |
105 protected void doExtremeCurveBaseOut(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { | 110 protected void doExtremeCurveBaseOut( |
111 ArtifactAndFacet aaf, | |
112 ThemeDocument theme, | |
113 boolean visible | |
114 ) { | |
106 log.debug("doExtremeCurveBaseOut"); | 115 log.debug("doExtremeCurveBaseOut"); |
107 ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); | 116 ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); |
108 Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); | 117 Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); |
109 if (curve == null) { | 118 if (curve == null) { |
110 log.warn("doExtremeCurveBaseOut: Facet does not contain Curve"); | 119 log.warn("doExtremeCurveBaseOut: Facet does not contain Curve"); |
111 return; | 120 return; |
112 } | 121 } |
113 | 122 |
114 XYSeries qwseries = new StyledXYSeries(aaf.getFacetDescription(), theme); | 123 XYSeries qwseries = new StyledXYSeries( |
124 aaf.getFacetDescription(), theme); | |
115 | 125 |
116 double gaugeDatum = getCurrentGaugeDatum(); | 126 double gaugeDatum = getCurrentGaugeDatum(); |
117 | 127 |
118 if (gaugeDatum == 0d) { | 128 if (gaugeDatum == 0d) { |
119 StyledSeriesBuilder.addPointsQW(qwseries, curve.getQs(), curve.getWs()); | 129 StyledSeriesBuilder.addPointsQW( |
130 qwseries, curve.getQs(), curve.getWs()); | |
120 addAxisSeries(qwseries, YAXIS.W.idx, visible); | 131 addAxisSeries(qwseries, YAXIS.W.idx, visible); |
121 } | 132 } |
122 else { | 133 else { |
123 XYSeries series2 = new StyledXYSeries(aaf.getFacetDescription(), theme); | 134 XYSeries series2 = |
124 StyledSeriesBuilder.addPointsQW(series2, curve.getQs(), curve.getWs()); | 135 new StyledXYSeries(aaf.getFacetDescription(), theme); |
136 StyledSeriesBuilder.addPointsQW( | |
137 series2, curve.getQs(), curve.getWs()); | |
125 addAxisSeries(series2, YAXIS.W.idx, false); | 138 addAxisSeries(series2, YAXIS.W.idx, false); |
126 | 139 |
127 StyledSeriesBuilder.addPointsQW(qwseries, curve.getQs(), curve.getWs(), -gaugeDatum, 100d); | 140 StyledSeriesBuilder.addPointsQW( |
141 qwseries, curve.getQs(), curve.getWs(), -gaugeDatum, 100d); | |
128 | 142 |
129 addAxisSeries(qwseries, YAXIS.WCm.idx, visible); | 143 addAxisSeries(qwseries, YAXIS.WCm.idx, visible); |
130 } | 144 } |
131 | 145 |
132 //addAxisSeries(qwseries, YAXIS.W.idx, visible); | 146 //addAxisSeries(qwseries, YAXIS.W.idx, visible); |
133 } | 147 } |
134 | 148 |
135 | 149 |
136 /** Do Extreme Curve out */ | 150 /** Do Extreme Curve out */ |
137 protected void doExtremeCurveOut(ArtifactAndFacet aaf, ThemeDocument theme, boolean visible) { | 151 protected void doExtremeCurveOut( |
152 ArtifactAndFacet aaf, | |
153 ThemeDocument theme, | |
154 boolean visible | |
155 ) { | |
138 log.debug("doExtremeCurveOut"); | 156 log.debug("doExtremeCurveOut"); |
139 ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); | 157 ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); |
140 Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); | 158 Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); |
141 if (curve == null) { | 159 if (curve == null) { |
142 log.warn("doExtremeCurveOut: Facet does not contain Curve"); | 160 log.warn("doExtremeCurveOut: Facet does not contain Curve"); |
229 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); | 247 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); |
230 if (pos == 0) { | 248 if (pos == 0) { |
231 unit = "cm"; | 249 unit = "cm"; |
232 } | 250 } |
233 | 251 |
234 return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT, new Object[] { unit }); | 252 return msg( |
253 I18N_YAXIS_LABEL, | |
254 I18N_YAXIS_LABEL_DEFAULT, | |
255 new Object[] { unit }); | |
235 } | 256 } |
236 } | 257 } |
237 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 258 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |