Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 3087:4a76da133144
Removed repeated x.size() calls from for loops.
flys-artifacts/trunk@4684 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 18 Jun 2012 09:16:05 +0000 |
parents | 8ad8a227d983 |
children | 6c91e05a5f51 |
comparison
equal
deleted
inserted
replaced
3086:ba7df29264cd | 3087:4a76da133144 |
---|---|
281 /** | 281 /** |
282 * Put debug output about datasets. | 282 * Put debug output about datasets. |
283 */ | 283 */ |
284 public void debugDatasets(XYPlot plot) { | 284 public void debugDatasets(XYPlot plot) { |
285 logger.debug("Number of datasets: " + plot.getDatasetCount()); | 285 logger.debug("Number of datasets: " + plot.getDatasetCount()); |
286 for (int i = 0; i < plot.getDatasetCount(); i++) { | 286 for (int i = 0, P = plot.getDatasetCount(); i < P; i++) { |
287 if (plot.getDataset(i) == null) { | 287 if (plot.getDataset(i) == null) { |
288 logger.debug("Dataset #" + i + " is null"); | 288 logger.debug("Dataset #" + i + " is null"); |
289 continue; | 289 continue; |
290 } | 290 } |
291 logger.debug("Dataset #" + i + ":" + plot.getDataset(i)); | 291 logger.debug("Dataset #" + i + ":" + plot.getDataset(i)); |
301 /** | 301 /** |
302 * Put debug output about axes. | 302 * Put debug output about axes. |
303 */ | 303 */ |
304 public void debugAxis(XYPlot plot) { | 304 public void debugAxis(XYPlot plot) { |
305 logger.debug("..............."); | 305 logger.debug("..............."); |
306 for (int i = 0; i < plot.getRangeAxisCount(); i++) { | 306 for (int i = 0, P = plot.getRangeAxisCount(); i < P; i++) { |
307 if (plot.getRangeAxis(i) == null) | 307 if (plot.getRangeAxis(i) == null) |
308 logger.debug("Range-Axis #" + i + " == null"); | 308 logger.debug("Range-Axis #" + i + " == null"); |
309 else { | 309 else { |
310 logger.debug("Range-Axis " + i + " != null [" + | 310 logger.debug("Range-Axis " + i + " != null [" + |
311 plot.getRangeAxis(i).getRange().getLowerBound() + | 311 plot.getRangeAxis(i).getRange().getLowerBound() + |
1214 // Add text annotations for single points. | 1214 // Add text annotations for single points. |
1215 List<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>(); | 1215 List<XYTextAnnotation> xy = new ArrayList<XYTextAnnotation>(); |
1216 | 1216 |
1217 try { | 1217 try { |
1218 JSONArray points = new JSONArray((String) o); | 1218 JSONArray points = new JSONArray((String) o); |
1219 for (int i = 0; i < points.length(); i++) { | 1219 for (int i = 0, P = points.length(); i < P; i++) { |
1220 JSONArray array = points.getJSONArray(i); | 1220 JSONArray array = points.getJSONArray(i); |
1221 double x = array.getDouble(0); | 1221 double x = array.getDouble(0); |
1222 double y = array.getDouble(1); | 1222 double y = array.getDouble(1); |
1223 String name = array.getString(2); | 1223 String name = array.getString(2); |
1224 boolean act = array.getBoolean(3); | 1224 boolean act = array.getBoolean(3); |