comparison flys-artifacts/src/main/java/de/intevation/flys/exports/StyledSeriesBuilder.java @ 2686:6fda6ec9e426

Added accidentally ommitted changes. flys-artifacts/trunk@4387 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 11 May 2012 07:11:01 +0000
parents 9e8459c2e7d4
children 5642a83420f2
comparison
equal deleted inserted replaced
2685:5652a851f1b4 2686:6fda6ec9e426
35 * Add points to series. 35 * Add points to series.
36 * 36 *
37 * @param series Series to add points to. 37 * @param series Series to add points to.
38 * @param points Points to add to series, points[0] to 1st dim, points[1] 38 * @param points Points to add to series, points[0] to 1st dim, points[1]
39 * to 2nd dim. 39 * to 2nd dim.
40 * @param skipNANs if true, skip NAN values in points parameter.
40 */ 41 */
41 public static void addPoints(XYSeries series, double[][] points) { 42 public static void addPoints(XYSeries series, double[][] points, boolean skipNANs) {
42 if (points == null || points.length <= 1) { 43 if (points == null || points.length <= 1) {
43 return; 44 return;
44 } 45 }
45 double [] xPoints = points[0]; 46 double [] xPoints = points[0];
46 double [] yPoints = points[1]; 47 double [] yPoints = points[1];
47 for (int i = 0; i < xPoints.length; i++) { 48 for (int i = 0; i < xPoints.length; i++) {
48 if (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i])) { 49 if (skipNANs &&
50 (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) {
49 logger.warn ("Skipping NaN in StyledSeriesBuilder."); 51 logger.warn ("Skipping NaN in StyledSeriesBuilder.");
50 continue; 52 continue;
51 } 53 }
52 series.add(xPoints[i], yPoints[i], false); 54 series.add(xPoints[i], yPoints[i], false);
53 } 55 }

http://dive4elements.wald.intevation.org