comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 2395:cd4fb19ab892

Some API changes in ChartGenerator and XYChartGenerator for fetching user specified zoom values. flys-artifacts/trunk@4021 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 10 Feb 2012 08:56:19 +0000
parents 1fcaeced48f2
children 5d8d24984819
comparison
equal deleted inserted replaced
2394:02ac373b6d69 2395:cd4fb19ab892
460 } 460 }
461 461
462 logger.debug("Prepare zoom settings for y axis at index: " + i); 462 logger.debug("Prepare zoom settings for y axis at index: " + i);
463 zoomY(plot, yaxis, yRanges.get(Integer.valueOf(i)), yrange); 463 zoomY(plot, yaxis, yRanges.get(Integer.valueOf(i)), yrange);
464 } 464 }
465 }
466
467
468 protected Range getDomainAxisRange() {
469 String[] ranges = getDomainAxisRangeFromRequest();
470
471 if (ranges == null || ranges.length < 2) {
472 logger.debug("No zoom range for domain axis specified.");
473 return null;
474 }
475
476 if (ranges[0].length() > 0 && ranges[1].length() > 0) {
477 try {
478 double from = Double.parseDouble(ranges[0]);
479 double to = Double.parseDouble(ranges[1]);
480
481 if (from == 0 && to == 0) {
482 logger.debug("No range specified. Lower and upper X == 0");
483 return null;
484 }
485
486 if (from > to) {
487 double tmp = to;
488 to = from;
489 from = tmp;
490 }
491
492 return new Range(from, to);
493 }
494 catch (NumberFormatException nfe) {
495 logger.warn("Wrong values for domain axis range.");
496 }
497 }
498
499 return null;
465 } 500 }
466 501
467 502
468 protected boolean zoomX(XYPlot plot, ValueAxis axis, Range range, Range x) { 503 protected boolean zoomX(XYPlot plot, ValueAxis axis, Range range, Range x) {
469 return zoom(plot, axis, range, x); 504 return zoom(plot, axis, range, x);

http://dive4elements.wald.intevation.org