Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.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 | 8ca2c711a632 |
children | bbf6cf555e89 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java Fri Sep 05 12:54:58 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/XYChartGenerator.java Fri Sep 05 12:58:17 2014 +0200 @@ -74,8 +74,8 @@ public static final int AXIS_SPACE = 5; - /** The logger that is used in this generator. */ - private static Logger logger = Logger.getLogger(XYChartGenerator.class); + /** The log that is used in this generator. */ + private static Logger log = Logger.getLogger(XYChartGenerator.class); protected List<Marker> domainMarkers = new ArrayList<Marker>(); @@ -103,7 +103,7 @@ */ @Override public JFreeChart generateChart() { - logger.debug("XYChartGenerator.generateChart"); + log.debug("XYChartGenerator.generateChart"); JFreeChart chart = ChartFactory.createXYLineChart( getChartTitle(), @@ -186,7 +186,7 @@ protected void addLogo(XYPlot plot) { String logo = showLogo(); if (logo == null) { - logger.debug("No logo to show chosen"); + log.debug("No logo to show chosen"); return; } @@ -232,7 +232,7 @@ yPos = ((Double)getYBounds(0).getUpper() + (Double)getYBounds(0).getLower())/2d; } else { - logger.debug("Unknown place-v value: " + placev); + log.debug("Unknown place-v value: " + placev); } if (placeh == null || placeh.equals("none")) { @@ -248,10 +248,10 @@ xPos = ((Double)getXBounds(0).getUpper() + (Double)getXBounds(0).getLower())/2d; } else { - logger.debug("Unknown place-h value: " + placeh); + log.debug("Unknown place-h value: " + placeh); } - logger.debug("logo position: " + xPos + "/" + yPos); + log.debug("logo position: " + xPos + "/" + yPos); org.jfree.ui.RectangleAnchor anchor = org.jfree.ui.RectangleAnchor.TOP; @@ -308,7 +308,7 @@ @Override protected AxisDataset createAxisDataset(int idx) { - logger.debug("Create new AxisDataset for index: " + idx); + log.debug("Create new AxisDataset for index: " + idx); return new AxisDataset(idx); } @@ -317,17 +317,17 @@ * Put debug output about datasets. */ public void debugDatasets(XYPlot plot) { - logger.debug("Number of datasets: " + plot.getDatasetCount()); + log.debug("Number of datasets: " + plot.getDatasetCount()); for (int i = 0, P = plot.getDatasetCount(); i < P; i++) { if (plot.getDataset(i) == null) { - logger.debug("Dataset #" + i + " is null"); + log.debug("Dataset #" + i + " is null"); continue; } - logger.debug("Dataset #" + i + ":" + plot.getDataset(i)); + log.debug("Dataset #" + i + ":" + plot.getDataset(i)); XYSeriesCollection series = (XYSeriesCollection) plot.getDataset(i); - logger.debug("X-Extend of Dataset: " + series.getSeries(0).getMinX() + log.debug("X-Extend of Dataset: " + series.getSeries(0).getMinX() + " " + series.getSeries(0).getMaxX()); - logger.debug("Y-Extend of Dataset: " + series.getSeries(0).getMinY() + log.debug("Y-Extend of Dataset: " + series.getSeries(0).getMinY() + " " + series.getSeries(0).getMaxY()); } } @@ -337,12 +337,12 @@ * Put debug output about axes. */ public void debugAxis(XYPlot plot) { - logger.debug("..............."); + log.debug("..............."); for (int i = 0, P = plot.getRangeAxisCount(); i < P; i++) { if (plot.getRangeAxis(i) == null) - logger.debug("Range-Axis #" + i + " == null"); + log.debug("Range-Axis #" + i + " == null"); else { - logger.debug("Range-Axis " + i + " != null [" + + log.debug("Range-Axis " + i + " != null [" + plot.getRangeAxis(i).getRange().getLowerBound() + " " + plot.getRangeAxis(i).getRange().getUpperBound() + "]"); @@ -350,15 +350,15 @@ } for (int i = 0, P = plot.getDomainAxisCount(); i < P; i++) { if (plot.getDomainAxis(i) == null) - logger.debug("Domain-Axis #" + i + " == null"); + log.debug("Domain-Axis #" + i + " == null"); else { - logger.debug("Domain-Axis " + i + " != null [" + + log.debug("Domain-Axis " + i + " != null [" + plot.getDomainAxis(i).getRange().getLowerBound() + " " + plot.getDomainAxis(i).getRange().getUpperBound() + "]"); } } - logger.debug("..............."); + log.debug("..............."); } @@ -370,7 +370,7 @@ */ public void addAreaSeries(StyledAreaSeriesCollection area, int index, boolean visible) { if (area == null) { - logger.warn("Cannot yet render above/under curve."); + log.warn("Cannot yet render above/under curve."); return; } @@ -398,7 +398,7 @@ return; } - logger.debug("Y Range of XYSeries: " + + log.debug("Y Range of XYSeries: " + series.getMinY() + " | " + series.getMaxY()); addAxisDataset(new XYSeriesCollection(series), index, visible); @@ -467,7 +467,7 @@ @Override protected void combineXBounds(Bounds bounds, int index) { if (!(bounds instanceof DoubleBounds)) { - logger.warn("Unsupported Bounds type: " + bounds.getClass()); + log.warn("Unsupported Bounds type: " + bounds.getClass()); return; } @@ -492,7 +492,7 @@ @Override protected void combineYBounds(Bounds bounds, int index) { if (!(bounds instanceof DoubleBounds)) { - logger.warn("Unsupported Bounds type: " + bounds.getClass()); + log.warn("Unsupported Bounds type: " + bounds.getClass()); return; } @@ -519,7 +519,7 @@ */ private void recoverEmptyPlot(XYPlot plot) { if (plot.getRangeAxis() == null) { - logger.debug("debug: No range axis"); + log.debug("debug: No range axis"); plot.setRangeAxis(createYAxis(0)); } } @@ -536,7 +536,7 @@ if (b != null && b.getLower().equals(b.getUpper())) { - logger.debug("Check whether to expand a x axis.i ("+b.getLower() + "-" + b.getUpper()+")"); + log.debug("Check whether to expand a x axis.i ("+b.getLower() + "-" + b.getUpper()+")"); setXBounds(key, ChartHelper.expandBounds(b, 5)); } } @@ -553,7 +553,7 @@ * @param plot The XYPlot. */ protected void autoZoom(XYPlot plot) { - logger.debug("Zoom to specified ranges."); + log.debug("Zoom to specified ranges."); Range xrange = getDomainAxisRange(); Range yrange = getValueAxisRange(); @@ -582,11 +582,11 @@ } if (yaxis == null) { - logger.debug("Zoom problem: no Y Axis for index: " + i); + log.debug("Zoom problem: no Y Axis for index: " + i); continue; } - logger.debug("Prepare zoom settings for y axis at index: " + i); + log.debug("Prepare zoom settings for y axis at index: " + i); zoomY(plot, yaxis, getYBounds(Integer.valueOf(i)), yrange); } } @@ -596,7 +596,7 @@ String[] ranges = getDomainAxisRangeFromRequest(); if (ranges == null || ranges.length < 2) { - logger.debug("No zoom range for domain axis specified."); + log.debug("No zoom range for domain axis specified."); return null; } @@ -606,7 +606,7 @@ double to = Double.parseDouble(ranges[1]); if (from == 0 && to == 0) { - logger.debug("No range specified. Lower and upper X == 0"); + log.debug("No range specified. Lower and upper X == 0"); return null; } @@ -619,7 +619,7 @@ return new Range(from, to); } catch (NumberFormatException nfe) { - logger.warn("Wrong values for domain axis range."); + log.warn("Wrong values for domain axis range."); } } @@ -631,7 +631,7 @@ String[] ranges = getValueAxisRangeFromRequest(); if (ranges == null || ranges.length < 2) { - logger.debug("No range specified. Lower and upper Y == 0"); + log.debug("No range specified. Lower and upper Y == 0"); return null; } @@ -641,7 +641,7 @@ double to = Double.parseDouble(ranges[1]); if (from == 0 && to == 0) { - logger.debug("No range specified. Lower and upper Y == 0"); + log.debug("No range specified. Lower and upper Y == 0"); return null; } @@ -650,7 +650,7 @@ : new Range(from, to); } catch (NumberFormatException nfe) { - logger.warn("Wrong values for value axis range."); + log.warn("Wrong values for value axis range."); } } @@ -688,7 +688,7 @@ Bounds computed = calculateZoom(bounds, x); computed.applyBounds(axis, AXIS_SPACE); - logger.debug("Zoom axis to: " + computed); + log.debug("Zoom axis to: " + computed); return true; } @@ -708,11 +708,11 @@ double min = bounds.getLower().doubleValue(); double max = bounds.getUpper().doubleValue(); - if (logger.isDebugEnabled()) { - logger.debug("Minimum is: " + min); - logger.debug("Maximum is: " + max); - logger.debug("Lower zoom is: " + range.getLowerBound()); - logger.debug("Upper zoom is: " + range.getUpperBound()); + if (log.isDebugEnabled()) { + log.debug("Minimum is: " + min); + log.debug("Maximum is: " + max); + log.debug("Lower zoom is: " + range.getLowerBound()); + log.debug("Upper zoom is: " + range.getUpperBound()); } double diff = max > min ? max - min : min - max; @@ -733,18 +733,18 @@ */ @Override public Range[] getRangesForAxis(int index) { - logger.debug("getRangesForAxis " + index); + log.debug("getRangesForAxis " + index); Bounds rx = getXBounds(Integer.valueOf(0)); Bounds ry = getYBounds(Integer.valueOf(index)); if (rx == null) { - logger.warn("Range for x axis not set." + + log.warn("Range for x axis not set." + " Using default values: 0 - 1."); rx = new DoubleBounds(0, 1); } if (ry == null) { - logger.warn("Range for y" + index + + log.warn("Range for y" + index + " axis not set. Using default values: 0 - 1."); ry = new DoubleBounds(0, 1); } @@ -830,7 +830,7 @@ localizeDomainAxis(axis); } else { - logger.warn("Domain axis at " + i + " is null."); + log.warn("Domain axis at " + i + " is null."); } } @@ -841,7 +841,7 @@ localizeRangeAxis(axis); } else { - logger.warn("Range axis at " + i + " is null."); + log.warn("Range axis at " + i + " is null."); } } } @@ -898,13 +898,13 @@ if (!act) { continue; } - //logger.debug(" x " + x + " y " + y ); + //log.debug(" x " + x + " y " + y ); series.add(x, y, false); xy.add(new CollisionFreeXYTextAnnotation(name, x, y)); } } catch(JSONException e){ - logger.error("Could not decode json."); + log.error("Could not decode json."); } RiverAnnotation annotations = new RiverAnnotation(null, null, null, theme);