Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 1736:0155cbaba182
XYChartGenerator: Do not crash if no zoom axis given
flys-artifacts/trunk@3025 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 19 Oct 2011 09:59:07 +0000 |
parents | 5966a20fc72c |
children | 6cdc7a77d3d4 |
comparison
equal
deleted
inserted
replaced
1735:5966a20fc72c | 1736:0155cbaba182 |
---|---|
381 * @param x A user defined range (null permitted). | 381 * @param x A user defined range (null permitted). |
382 * | 382 * |
383 * @return true, if a zoom range was specified, otherwise false. | 383 * @return true, if a zoom range was specified, otherwise false. |
384 */ | 384 */ |
385 protected boolean zoom(XYPlot plot, ValueAxis axis, Range range, Range x) { | 385 protected boolean zoom(XYPlot plot, ValueAxis axis, Range range, Range x) { |
386 | |
387 if (range == null) { | |
388 return false; | |
389 } | |
390 | |
386 if (x != null) { | 391 if (x != null) { |
387 double min = range.getLowerBound(); | 392 double min = range.getLowerBound(); |
388 double max = range.getUpperBound(); | 393 double max = range.getUpperBound(); |
389 double diff = max > min ? max - min : min - max; | 394 double diff = max > min ? max - min : min - max; |
390 | 395 |