Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.java @ 9123:1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
author | gernotbelger |
---|---|
date | Tue, 05 Jun 2018 19:21:16 +0200 |
parents | 5e38e2924c07 |
children | 740d65e4aa14 |
comparison
equal
deleted
inserted
replaced
9122:b8e7f6becf78 | 9123:1cc7653ca84f |
---|---|
8 | 8 |
9 package org.dive4elements.river.exports; | 9 package org.dive4elements.river.exports; |
10 | 10 |
11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; | 11 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
12 import org.dive4elements.artifactdatabase.state.Facet; | 12 import org.dive4elements.artifactdatabase.state.Facet; |
13 import org.dive4elements.artifacts.CallContext; | |
13 import org.dive4elements.river.artifacts.D4EArtifact; | 14 import org.dive4elements.river.artifacts.D4EArtifact; |
14 import org.dive4elements.river.artifacts.geom.Lines; | 15 import org.dive4elements.river.artifacts.geom.Lines; |
15 import org.dive4elements.river.artifacts.model.AreaFacet; | 16 import org.dive4elements.river.artifacts.model.AreaFacet; |
16 import org.dive4elements.river.artifacts.model.FacetTypes; | 17 import org.dive4elements.river.artifacts.model.FacetTypes; |
17 import org.dive4elements.river.artifacts.model.WKms; | 18 import org.dive4elements.river.artifacts.model.WKms; |
155 * Returns the default title for this chart. | 156 * Returns the default title for this chart. |
156 * | 157 * |
157 * @return the default title for this chart. | 158 * @return the default title for this chart. |
158 */ | 159 */ |
159 @Override | 160 @Override |
160 public String getDefaultChartTitle() { | 161 public String getDefaultChartTitle(final CallContext context) { |
161 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); | 162 return msg(I18N_CHART_TITLE, I18N_CHART_TITLE_DEFAULT); |
162 } | 163 } |
163 | |
164 | 164 |
165 /** | 165 /** |
166 * Returns the default subtitle for this chart. | 166 * Returns the default subtitle for this chart. |
167 * | 167 * |
168 * @return the default subtitle for this chart. | 168 * @return the default subtitle for this chart. |
169 */ | 169 */ |
170 @Override | 170 @Override |
171 protected String getDefaultChartSubtitle() { | 171 protected String getDefaultChartSubtitle(final CallContext context) { |
172 double[] dist = getRange(); | 172 double[] dist = getRange(); |
173 | 173 |
174 Object[] args = null; | 174 Object[] args = null; |
175 if (dist == null) { | 175 if (dist == null) { |
176 args = new Object[] {getRiverName()}; | 176 args = new Object[] {getRiverName()}; |
206 | 206 |
207 /** | 207 /** |
208 * Get internationalized label for the x axis. | 208 * Get internationalized label for the x axis. |
209 */ | 209 */ |
210 @Override | 210 @Override |
211 protected String getDefaultXAxisLabel() { | 211 protected String getDefaultXAxisLabel(CallContext context) { |
212 D4EArtifact flys = (D4EArtifact) master; | 212 D4EArtifact flys = getArtifact(); |
213 | 213 |
214 return msg( | 214 return msg( |
215 I18N_XAXIS_LABEL, | 215 I18N_XAXIS_LABEL, |
216 I18N_XAXIS_LABEL_DEFAULT, | 216 I18N_XAXIS_LABEL_DEFAULT, |
217 new Object[] { RiverUtils.getRiver(flys).getName() }); | 217 new Object[] { RiverUtils.getRiver(flys).getName() }); |
239 | 239 |
240 /** | 240 /** |
241 * Get internationalized label for the y axis. | 241 * Get internationalized label for the y axis. |
242 */ | 242 */ |
243 protected String getWAxisLabel() { | 243 protected String getWAxisLabel() { |
244 D4EArtifact flys = (D4EArtifact) master; | 244 D4EArtifact flys = getArtifact(); |
245 | 245 |
246 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); | 246 String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); |
247 | 247 |
248 return msg( | 248 return msg( |
249 I18N_YAXIS_LABEL, | 249 I18N_YAXIS_LABEL, |
338 | 338 |
339 if (facet == null) { | 339 if (facet == null) { |
340 return; | 340 return; |
341 } | 341 } |
342 | 342 |
343 CallContext context = getContext(); | |
344 | |
343 Processor wProcessor = new WOutProcessor(); | 345 Processor wProcessor = new WOutProcessor(); |
344 Processor qProcessor = new QOutProcessor(); | 346 Processor qProcessor = new QOutProcessor(); |
345 Processor bdyProcessor = new BedDiffYearProcessor(); | 347 Processor bdyProcessor = new BedDiffYearProcessor(); |
346 Processor bdhyProcessor = new BedDiffHeightYearProcessor(); | 348 Processor bdhyProcessor = new BedDiffHeightYearProcessor(); |
347 Processor annotationProcessor = new AnnotationProcessor(); | 349 Processor annotationProcessor = new AnnotationProcessor(); |