comparison artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator.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 e4606eae8ea5
children 1cc7653ca84f 0a5239a1e46e
comparison
equal deleted inserted replaced
8855:d7c005e12af0 8856:5e38e2924c07
90 "chart.longitudinal.section.yaxis.label"; 90 "chart.longitudinal.section.yaxis.label";
91 91
92 public static final String I18N_2YAXIS_LABEL = 92 public static final String I18N_2YAXIS_LABEL =
93 "chart.longitudinal.section.yaxis.second.label"; 93 "chart.longitudinal.section.yaxis.second.label";
94 94
95 public static final String I18N_CHART_TITLE_DEFAULT = "W-L\u00e4ngsschnitt"; 95 public static final String I18N_CHART_TITLE_DEFAULT =
96 "W-L\u00e4ngsschnitt";
96 public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; 97 public static final String I18N_XAXIS_LABEL_DEFAULT = "km";
97 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; 98 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]";
98 public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]"; 99 public static final String I18N_2YAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]";
99 100
100 public final static String I18N_WDIFF_YAXIS_LABEL = 101 public final static String I18N_WDIFF_YAXIS_LABEL =
226 } 227 }
227 else if (index == YAXIS.Q.idx) { 228 else if (index == YAXIS.Q.idx) {
228 label = msg(getQAxisLabelKey(), getQAxisDefaultLabel()); 229 label = msg(getQAxisLabelKey(), getQAxisDefaultLabel());
229 } 230 }
230 else if (index == YAXIS.D.idx) { 231 else if (index == YAXIS.D.idx) {
231 label = msg(I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT); 232 label = msg(
233 I18N_WDIFF_YAXIS_LABEL, I18N_WDIFF_YAXIS_LABEL_DEFAULT);
232 } 234 }
233 235
234 return label; 236 return label;
235 } 237 }
236 238
343 Processor bdyProcessor = new BedDiffYearProcessor(); 345 Processor bdyProcessor = new BedDiffYearProcessor();
344 Processor bdhyProcessor = new BedDiffHeightYearProcessor(); 346 Processor bdhyProcessor = new BedDiffHeightYearProcessor();
345 Processor annotationProcessor = new AnnotationProcessor(); 347 Processor annotationProcessor = new AnnotationProcessor();
346 348
347 if (wProcessor.canHandle(name)) { 349 if (wProcessor.canHandle(name)) {
348 wProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); 350 wProcessor.doOut(
351 this, artifactAndFacet, attr, visible, YAXIS.W.idx);
349 } 352 }
350 if (qProcessor.canHandle(name)) { 353 if (qProcessor.canHandle(name)) {
351 qProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.Q.idx); 354 qProcessor.doOut(
355 this, artifactAndFacet, attr, visible, YAXIS.Q.idx);
352 } 356 }
353 else if (bdyProcessor.canHandle(name)) { 357 else if (bdyProcessor.canHandle(name)) {
354 bdyProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); 358 bdyProcessor.doOut(
359 this, artifactAndFacet, attr, visible, YAXIS.W.idx);
355 } 360 }
356 else if (bdhyProcessor.canHandle(name)) { 361 else if (bdhyProcessor.canHandle(name)) {
357 bdhyProcessor.doOut(this, artifactAndFacet, attr, visible, YAXIS.W.idx); 362 bdhyProcessor.doOut(
363 this, artifactAndFacet, attr, visible, YAXIS.W.idx);
358 } 364 }
359 else if (annotationProcessor.canHandle(name)) { 365 else if (annotationProcessor.canHandle(name)) {
360 annotationProcessor.doOut(this, artifactAndFacet, attr, visible, 0); 366 annotationProcessor.doOut(
367 this, artifactAndFacet, attr, visible, 0);
361 } 368 }
362 else if (name.equals(W_DIFFERENCES)) { 369 else if (name.equals(W_DIFFERENCES)) {
363 doWDifferencesOut( 370 doWDifferencesOut(
364 (WKms) artifactAndFacet.getData(context), 371 (WKms) artifactAndFacet.getData(context),
365 artifactAndFacet, 372 artifactAndFacet,
400 if (wkms == null) { 407 if (wkms == null) {
401 log.warn("No data to add to WDifferencesChart."); 408 log.warn("No data to add to WDifferencesChart.");
402 return; 409 return;
403 } 410 }
404 411
405 XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme); 412 XYSeries series =
413 new StyledXYSeries(aandf.getFacetDescription(), theme);
406 414
407 if (log.isDebugEnabled()) { 415 if (log.isDebugEnabled()) {
408 if (wkms.size() > 0) { 416 if (wkms.size() > 0) {
409 log.debug("Generate series: " + series.getKey()); 417 log.debug("Generate series: " + series.getKey());
410 log.debug("Start km: " + wkms.getKm(0)); 418 log.debug("Start km: " + wkms.getKm(0));
471 479
472 if (data.getUpperData() != null) { 480 if (data.getUpperData() != null) {
473 up = new StyledXYSeries(seriesName, false, theme); 481 up = new StyledXYSeries(seriesName, false, theme);
474 if (data.getUpperData() instanceof WQKms) { 482 if (data.getUpperData() instanceof WQKms) {
475 if (FacetTypes.IS.Q(data.getUpperFacetName())) { 483 if (FacetTypes.IS.Q(data.getUpperFacetName())) {
476 StyledSeriesBuilder.addPointsKmQ(up, (WQKms) data.getUpperData()); 484 StyledSeriesBuilder.addPointsKmQ(
485 up, (WQKms)data.getUpperData());
477 } 486 }
478 else { 487 else {
479 StyledSeriesBuilder.addPoints(up, (WKms) data.getUpperData()); 488 StyledSeriesBuilder.addPoints(
489 up, (WKms) data.getUpperData());
480 } 490 }
481 } 491 }
482 else if (data.getUpperData() instanceof double[][]) { 492 else if (data.getUpperData() instanceof double[][]) {
483 StyledSeriesBuilder.addPoints(up, (double [][]) data.getUpperData(), false); 493 StyledSeriesBuilder.addPoints(
494 up, (double [][]) data.getUpperData(), false);
484 } 495 }
485 else if (data.getUpperData() instanceof WKms) { 496 else if (data.getUpperData() instanceof WKms) {
486 StyledSeriesBuilder.addPoints(up, (WKms) data.getUpperData()); 497 StyledSeriesBuilder.addPoints(up, (WKms) data.getUpperData());
487 } 498 }
488 else if (data.getUpperData() instanceof Lines.LineData) { 499 else if (data.getUpperData() instanceof Lines.LineData) {
489 StyledSeriesBuilder.addPoints(up, ((Lines.LineData) data.getUpperData()).points, false); 500 StyledSeriesBuilder.addPoints(
501 up, ((Lines.LineData) data.getUpperData()).points, false);
490 } 502 }
491 else { 503 else {
492 log.error("Do not know how to deal with (up) area info from: " 504 log.error("Do not know how to deal with (up) area info from: "
493 + data.getUpperData()); 505 + data.getUpperData());
494 } 506 }
495 } 507 }
496 508
497 // TODO Depending on style, the area (e.g. 20m^2) should be added as annotation. 509 // TODO Depending on style, the area (e.g. 20m^2)
510 // should be added as annotation.
498 511
499 if (data.getLowerData() != null) { 512 if (data.getLowerData() != null) {
500 // TODO: Sort this out: when the two series have the same name, 513 // TODO: Sort this out: when the two series have the same name,
501 // the renderer (or anything in between) will not work correctly. 514 // the renderer (or anything in between) will not work correctly.
502 down = new StyledXYSeries(seriesName + " ", false, theme); 515 down = new StyledXYSeries(seriesName + " ", false, theme);
503 if (data.getLowerData() instanceof WQKms) { 516 if (data.getLowerData() instanceof WQKms) {
504 if (FacetTypes.IS.Q(data.getLowerFacetName())) { 517 if (FacetTypes.IS.Q(data.getLowerFacetName())) {
505 StyledSeriesBuilder.addPointsKmQ(down, (WQKms) data.getLowerData()); 518 StyledSeriesBuilder.addPointsKmQ(
519 down, (WQKms) data.getLowerData());
506 } 520 }
507 else { 521 else {
508 StyledSeriesBuilder.addPoints(down, (WQKms) data.getLowerData()); 522 StyledSeriesBuilder.addPoints(
523 down, (WQKms) data.getLowerData());
509 } 524 }
510 } 525 }
511 else if (data.getLowerData() instanceof double[][]) { 526 else if (data.getLowerData() instanceof double[][]) {
512 StyledSeriesBuilder.addPoints(down, (double[][]) data.getLowerData(), false); 527 StyledSeriesBuilder.addPoints(
528 down, (double[][]) data.getLowerData(), false);
513 } 529 }
514 else if (data.getLowerData() instanceof WKms) { 530 else if (data.getLowerData() instanceof WKms) {
515 StyledSeriesBuilder.addPoints(down, (WKms) data.getLowerData()); 531 StyledSeriesBuilder.addPoints(
532 down, (WKms) data.getLowerData());
516 } 533 }
517 else if (data.getLowerData() instanceof Lines.LineData) { 534 else if (data.getLowerData() instanceof Lines.LineData) {
518 StyledSeriesBuilder.addPoints(down, ((Lines.LineData) data.getLowerData()).points, false); 535 StyledSeriesBuilder.addPoints(
536 down,
537 ((Lines.LineData) data.getLowerData()).points,
538 false);
519 } 539 }
520 else { 540 else {
521 log.error("Do not know how to deal with (down) area info from: " 541 log.error(
542 "Do not know how to deal with (down) area info from: "
522 + data.getLowerData()); 543 + data.getLowerData());
523 } 544 }
524 } 545 }
525 546
526 if (up == null && down != null) { 547 if (up == null && down != null) {

http://dive4elements.wald.intevation.org