Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.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 | 8b8407c71ee2 |
children | 42b258294067 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java Fri Sep 05 12:54:58 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/TimeseriesChartGenerator.java Fri Sep 05 12:58:17 2014 +0200 @@ -69,7 +69,7 @@ protected boolean domainZeroLineVisible; - private static final Logger logger = + private static final Logger log = Logger.getLogger(TimeseriesChartGenerator.class); public static final int AXIS_SPACE = 5; @@ -96,7 +96,7 @@ @Override public JFreeChart generateChart() { - logger.info("Generate Timeseries Chart."); + log.info("Generate Timeseries Chart."); JFreeChart chart = ChartFactory.createTimeSeriesChart( getChartTitle(), @@ -158,7 +158,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; } @@ -202,7 +202,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")) { @@ -218,10 +218,10 @@ xPos = ((Long)getXBounds(0).getUpper() + (Long)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; @@ -276,7 +276,7 @@ * @param plot The XYPlot. */ protected void consumeAxisSettings(XYPlot plot) { - logger.debug("Zoom to specified ranges."); + log.debug("Zoom to specified ranges."); Bounds xrange = getDomainAxisRange(); Bounds yrange = getValueAxisRange(); @@ -305,11 +305,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); } } @@ -328,7 +328,7 @@ */ @Override protected AxisDataset createAxisDataset(int idx) { - logger.debug("Create a new AxisDataset for index: " + idx); + log.debug("Create a new AxisDataset for index: " + idx); return new AxisDataset(idx); } @@ -405,25 +405,25 @@ public Bounds[] getBoundsForAxis(int index) { - logger.debug("Return x and y bounds for axis at: " + index); + log.debug("Return x and y bounds for axis at: " + index); Bounds rx = getXBounds(Integer.valueOf(index)); 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 TimeBounds(0l, 1l); } if (ry == null) { - logger.warn("Range for y axis not set." + + log.warn("Range for y axis not set." + " Using default values: 0 - 1."); ry = new DoubleBounds(0l, 1l); } - logger.debug("X Bounds at index " + index + " is: " + rx); - logger.debug("Y Bounds at index " + index + " is: " + ry); + log.debug("X Bounds at index " + index + " is: " + rx); + log.debug("Y Bounds at index " + index + " is: " + ry); return new Bounds[] {rx, ry}; } @@ -434,12 +434,12 @@ 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; } if (ranges[0] == null || ranges[1] == null) { - logger.warn("Invalid ranges for domain axis specified!"); + log.warn("Invalid ranges for domain axis specified!"); return null; } @@ -450,7 +450,7 @@ return new DoubleBounds(lower, upper); } catch (NumberFormatException nfe) { - logger.warn("Invalid ranges for domain axis specified: " + nfe); + log.warn("Invalid ranges for domain axis specified: " + nfe); } return null; @@ -461,12 +461,12 @@ String[] ranges = getValueAxisRangeFromRequest(); 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; } if (ranges[0] == null || ranges[1] == null) { - logger.warn("Invalid ranges for domain axis specified!"); + log.warn("Invalid ranges for domain axis specified!"); return null; } @@ -477,7 +477,7 @@ return new DoubleBounds(lower, upper); } catch (NumberFormatException nfe) { - logger.warn("Invalid ranges for domain axis specified: " + nfe); + log.warn("Invalid ranges for domain axis specified: " + nfe); } return null; @@ -485,7 +485,7 @@ protected void adaptZoom(XYPlot plot) { - logger.debug("Adapt zoom of Timeseries chart."); + log.debug("Adapt zoom of Timeseries chart."); zoomX(plot, plot.getDomainAxis(), getXBounds(0), getDomainAxisRange()); @@ -512,10 +512,10 @@ Bounds total,//we could equally nicely getXBounds(0) Bounds user ) { - if (logger.isDebugEnabled()) { - logger.debug("== Zoom X axis =="); - logger.debug(" Total axis range : " + total); - logger.debug(" User defined range: " + user); + if (log.isDebugEnabled()) { + log.debug("== Zoom X axis =="); + log.debug(" Total axis range : " + total); + log.debug(" User defined range: " + user); } if (user != null) { @@ -528,12 +528,12 @@ TimeBounds newBounds = new TimeBounds(newMin, newMax); - logger.debug(" Zoom axis to: " + newBounds); + log.debug(" Zoom axis to: " + newBounds); newBounds.applyBounds(axis, AXIS_SPACE); } else { - logger.debug("No user specified zoom values found!"); + log.debug("No user specified zoom values found!"); if (total != null && axis != null) { total.applyBounds(axis, AXIS_SPACE); } @@ -550,10 +550,10 @@ Bounds total, Bounds user ) { - if (logger.isDebugEnabled()) { - logger.debug("== Zoom Y axis =="); - logger.debug(" Total axis range : " + total); - logger.debug(" User defined range: " + user); + if (log.isDebugEnabled()) { + log.debug("== Zoom Y axis =="); + log.debug(" Total axis range : " + total); + log.debug(" User defined range: " + user); } if (user != null) { @@ -566,12 +566,12 @@ DoubleBounds newBounds = new DoubleBounds(newMin, newMax); - logger.debug(" Zoom axis to: " + newBounds); + log.debug(" Zoom axis to: " + newBounds); newBounds.applyBounds(axis, AXIS_SPACE); } else { - logger.debug("No user specified zoom values found!"); + log.debug("No user specified zoom values found!"); if (total != null && axis != null) { total.applyBounds(axis, AXIS_SPACE); } @@ -660,10 +660,10 @@ } } catch(JSONException ex) { - logger.error("Could not decode json"); + log.error("Could not decode json"); } catch(ParseException ex) { - logger.error("Could not parse date string"); + log.error("Could not parse date string"); } TimeSeriesCollection tsc = new TimeSeriesCollection(); @@ -674,7 +674,7 @@ double y = tsc.getYValue(0, i); xy.add(new CollisionFreeXYTextAnnotation( names.get(series.getTimePeriod(i)), x, y)); - logger.debug("doPoints(): x=" + x + " y=" + y); + log.debug("doPoints(): x=" + x + " y=" + y); } RiverAnnotation annotations = new RiverAnnotation(null, null, null, theme); @@ -687,9 +687,9 @@ } public void addDomainAxisMarker(XYPlot plot) { - logger.debug("domainmarkers: " + domainMarker.size()); + log.debug("domainmarkers: " + domainMarker.size()); for (Marker marker: domainMarker) { - logger.debug("adding domain marker"); + log.debug("adding domain marker"); plot.addDomainMarker(marker, Layer.BACKGROUND); } domainMarker.clear(); @@ -697,7 +697,7 @@ public void addValueAxisMarker(XYPlot plot) { for (Marker marker: valueMarker) { - logger.debug("adding value marker.."); + log.debug("adding value marker.."); plot.addRangeMarker(marker, Layer.BACKGROUND); } valueMarker.clear(); @@ -763,7 +763,7 @@ legendItem.getLinePaint() ); interLegend.setSeriesKey(series.getKey()); - logger.debug("applySeriesAttributes: draw unfilled legend item"); + log.debug("applySeriesAttributes: draw unfilled legend item"); plot.getLegendItems().add(interLegend); } }