Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/ChartHelper.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | af13ceeba52a |
children | 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
25 /** | 25 /** |
26 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 26 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
27 */ | 27 */ |
28 public class ChartHelper { | 28 public class ChartHelper { |
29 | 29 |
30 private static final Logger logger = Logger.getLogger(ChartHelper.class); | 30 private static final Logger log = Logger.getLogger(ChartHelper.class); |
31 | 31 |
32 | 32 |
33 /** | 33 /** |
34 * This method returns the ranges of the XYDataset <i>dataset</i> as array | 34 * This method returns the ranges of the XYDataset <i>dataset</i> as array |
35 * with [xrange, yrange]. | 35 * with [xrange, yrange]. |
40 */ | 40 */ |
41 public static Bounds[] getBounds(XYSeriesCollection dataset) { | 41 public static Bounds[] getBounds(XYSeriesCollection dataset) { |
42 int seriesCount = dataset != null ? dataset.getSeriesCount() : 0; | 42 int seriesCount = dataset != null ? dataset.getSeriesCount() : 0; |
43 | 43 |
44 if (seriesCount == 0) { | 44 if (seriesCount == 0) { |
45 logger.warn("Dataset is empty or has no Series set."); | 45 log.warn("Dataset is empty or has no Series set."); |
46 return null; | 46 return null; |
47 } | 47 } |
48 | 48 |
49 boolean foundValue = false; | 49 boolean foundValue = false; |
50 | 50 |
57 for (int j = 0, n = dataset.getItemCount(i); j < n; j++) { | 57 for (int j = 0, n = dataset.getItemCount(i); j < n; j++) { |
58 double x = dataset.getXValue(i, j); | 58 double x = dataset.getXValue(i, j); |
59 double y = dataset.getYValue(i, j); | 59 double y = dataset.getYValue(i, j); |
60 | 60 |
61 if (Double.isNaN(x) || Double.isNaN(y)) { | 61 if (Double.isNaN(x) || Double.isNaN(y)) { |
62 logger.warn("Item " + j + " in Series " + i + " is broken"); | 62 log.warn("Item " + j + " in Series " + i + " is broken"); |
63 continue; | 63 continue; |
64 } | 64 } |
65 | 65 |
66 foundValue = true; | 66 foundValue = true; |
67 | 67 |
97 } | 97 } |
98 else if(dataset instanceof TimeSeriesCollection) { | 98 else if(dataset instanceof TimeSeriesCollection) { |
99 return getBounds((TimeSeriesCollection) dataset); | 99 return getBounds((TimeSeriesCollection) dataset); |
100 } | 100 } |
101 else { | 101 else { |
102 logger.warn("Unknown XYDataset instance: " + dataset.getClass()); | 102 log.warn("Unknown XYDataset instance: " + dataset.getClass()); |
103 return null; | 103 return null; |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 | 107 |
108 public static Bounds[] getBounds(TimeSeriesCollection collection) { | 108 public static Bounds[] getBounds(TimeSeriesCollection collection) { |
109 int seriesCount = collection != null ? collection.getSeriesCount() : 0; | 109 int seriesCount = collection != null ? collection.getSeriesCount() : 0; |
110 | 110 |
111 if (seriesCount == 0) { | 111 if (seriesCount == 0) { |
112 logger.warn("TimeSeriesCollection is empty or has no Series set."); | 112 log.warn("TimeSeriesCollection is empty or has no Series set."); |
113 return null; | 113 return null; |
114 } | 114 } |
115 | 115 |
116 boolean foundValue = false; | 116 boolean foundValue = false; |
117 | 117 |