Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/LongitudinalSectionGenerator.java @ 1712:7e19449d7826
#253 Modified the title creation of chart curves - titles will now equal the Facet's description.
flys-artifacts/trunk@2984 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 17 Oct 2011 10:47:36 +0000 |
parents | 6e59208839ae |
children | 62983d0ced51 |
comparison
equal
deleted
inserted
replaced
1711:f708120cb7bc | 1712:7e19449d7826 |
---|---|
257 if (f == null) { | 257 if (f == null) { |
258 return; | 258 return; |
259 } | 259 } |
260 | 260 |
261 if (name.equals(LONGITUDINAL_W)) { | 261 if (name.equals(LONGITUDINAL_W)) { |
262 doWOut((WQKms) f.getData(artifact, context), attr, visible); | 262 doWOut((WQKms) f.getData(artifact, context), facet, attr, visible); |
263 } | 263 } |
264 else if (name.equals(LONGITUDINAL_Q)) { | 264 else if (name.equals(LONGITUDINAL_Q)) { |
265 doQOut((WQKms) f.getData(artifact, context), attr, visible); | 265 doQOut((WQKms) f.getData(artifact, context), facet, attr, visible); |
266 } | 266 } |
267 else if (name.equals(LONGITUDINAL_ANNOTATION)) { | 267 else if (name.equals(LONGITUDINAL_ANNOTATION)) { |
268 doAnnotationsOut(f.getData(artifact, context), attr, visible); | 268 doAnnotationsOut(f.getData(artifact, context), facet, attr,visible); |
269 } | 269 } |
270 else { | 270 else { |
271 logger.warn("Unknown facet name: " + name); | 271 logger.warn("Unknown facet name: " + name); |
272 return; | 272 return; |
273 } | 273 } |
276 | 276 |
277 /** | 277 /** |
278 * Register annotations available for the diagram. | 278 * Register annotations available for the diagram. |
279 * | 279 * |
280 * @param o list of annotations (data of facet). | 280 * @param o list of annotations (data of facet). |
281 * @param facet The facet. This facet does NOT support any data objects. Use | |
282 * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports | |
283 * data. | |
281 * @param theme yet ignored. | 284 * @param theme yet ignored. |
282 */ | 285 * @param visible The visibility of the annotations. |
283 protected void doAnnotationsOut(Object o, Document theme, boolean visible) { | 286 */ |
287 protected void doAnnotationsOut( | |
288 Object o, | |
289 Facet facet, | |
290 Document theme, | |
291 boolean visible | |
292 ) { | |
284 logger.debug("LongitudinalSectionGenerator.doAnnotationsOut"); | 293 logger.debug("LongitudinalSectionGenerator.doAnnotationsOut"); |
285 | 294 |
286 // Add all annotations in list o to our annotation pool. | 295 // Add all annotations in list o to our annotation pool. |
287 FLYSAnnotation fa = (FLYSAnnotation) o; | 296 FLYSAnnotation fa = (FLYSAnnotation) o; |
297 fa.setLabel(facet.getDescription()); | |
288 addAnnotations(fa, visible); | 298 addAnnotations(fa, visible); |
289 } | 299 } |
290 | 300 |
291 | 301 |
292 /** | 302 /** |
293 * Process the output for W facets in a longitudinal section curve. | 303 * Process the output for W facets in a longitudinal section curve. |
294 * | 304 * |
295 * @param wqkms An array of WQKms values. | 305 * @param wqkms An array of WQKms values. |
306 * @param facet The facet. This facet does NOT support any data objects. Use | |
307 * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports | |
308 * data. | |
296 * @param theme The theme that contains styling information. | 309 * @param theme The theme that contains styling information. |
297 */ | 310 * @param visible The visibility of the curve. |
298 protected void doWOut(WQKms wqkms, Document theme, boolean visible) { | 311 */ |
312 protected void doWOut( | |
313 WQKms wqkms, | |
314 Facet facet, | |
315 Document theme, | |
316 boolean visible | |
317 ) { | |
299 logger.debug("LongitudinalSectionGenerator.doWOut"); | 318 logger.debug("LongitudinalSectionGenerator.doWOut"); |
300 | 319 |
301 XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "W"), theme); | 320 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
302 | 321 |
303 int size = wqkms.size(); | 322 int size = wqkms.size(); |
304 | 323 |
305 for (int i = 0; i < size; i++) { | 324 for (int i = 0; i < size; i++) { |
306 series.add(wqkms.getKm(i), wqkms.getW(i), false); | 325 series.add(wqkms.getKm(i), wqkms.getW(i), false); |
316 | 335 |
317 /** | 336 /** |
318 * Process the output for Q facets in a longitudinal section curve. | 337 * Process the output for Q facets in a longitudinal section curve. |
319 * | 338 * |
320 * @param wqkms An array of WQKms values. | 339 * @param wqkms An array of WQKms values. |
340 * @param facet The facet. This facet does NOT support any data objects. Use | |
341 * FLYSArtifact.getNativeFacet() instead to retrieve a Facet which supports | |
342 * data. | |
321 * @param theme The theme that contains styling information. | 343 * @param theme The theme that contains styling information. |
322 */ | 344 * @param visible The visibility of the curve. |
323 protected void doQOut(WQKms wqkms, Document theme, boolean visible) { | 345 */ |
346 protected void doQOut( | |
347 WQKms wqkms, | |
348 Facet facet, | |
349 Document theme, | |
350 boolean visible | |
351 ) { | |
324 logger.debug("LongitudinalSectionGenerator.doQOut"); | 352 logger.debug("LongitudinalSectionGenerator.doQOut"); |
325 | 353 |
326 XYSeries series = new StyledXYSeries(getSeriesName(wqkms, "Q"), theme); | 354 XYSeries series = new StyledXYSeries(facet.getDescription(), theme); |
327 | 355 |
328 int size = wqkms.size(); | 356 int size = wqkms.size(); |
329 | 357 |
330 for (int i = 0; i < size; i++) { | 358 for (int i = 0; i < size; i++) { |
331 series.add(wqkms.getKm(i), wqkms.getQ(i), false); | 359 series.add(wqkms.getKm(i), wqkms.getQ(i), false); |