diff artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.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 8ad0b7bc3e73
children 2f7f9ced46a5
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Fri Sep 05 12:54:58 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java	Fri Sep 05 12:58:17 2014 +0200
@@ -98,8 +98,8 @@
 
     public static final int AXIS_SPACE = 5;
 
-    /** The logger that is used in this generator. */
-    private static Logger logger = Logger.getLogger(DiagramGenerator.class);
+    /** The log that is used in this generator. */
+    private static Logger log = Logger.getLogger(DiagramGenerator.class);
 
     protected List<Marker> domainMarkers = new ArrayList<Marker>();
 
@@ -136,7 +136,7 @@
     public void setup(Object config) {
 
         if (!(config instanceof DiagramAttributes)) {
-            logger.error("invalid config type");
+            log.error("invalid config type");
             return;
         }
         DiagramAttributes da = (DiagramAttributes)config;
@@ -162,9 +162,9 @@
         if (dx != null) {
             inverted = (Boolean)dx.isInverted()
                 .evaluate((D4EArtifact)getMaster(), context);
-            logger.debug("setInvertedFromConfig: " + inverted);
+            log.debug("setInvertedFromConfig: " + inverted);
         } else {
-            logger.debug("setInvertedFromConfig no domain axis found?");
+            log.debug("setInvertedFromConfig no domain axis found?");
         }
     }
 
@@ -173,7 +173,7 @@
      */
     @Override
     public JFreeChart generateChart() {
-        logger.debug("DiagramGenerator.generateChart");
+        log.debug("DiagramGenerator.generateChart");
 
         JFreeChart chart = ChartFactory.createXYLineChart(
             getChartTitle(),
@@ -265,7 +265,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;
         }
 
@@ -311,7 +311,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")) {
@@ -327,10 +327,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;
@@ -396,7 +396,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);
     }
 
@@ -405,17 +405,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());
         }
     }
@@ -425,12 +425,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() +
                     "]");
@@ -438,15 +438,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("...............");
     }
 
     /**
@@ -467,7 +467,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;
         }
 
@@ -494,7 +494,7 @@
             return;
         }
 
-        logger.debug("Y Range of XYSeries: " +
+        log.debug("Y Range of XYSeries: " +
             series.getMinY() + " | " + series.getMaxY());
 
         addAxisDataset(new XYMetaSeriesCollection(series), index, visible);
@@ -576,7 +576,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;
         }
 
@@ -601,7 +601,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;
         }
 
@@ -628,7 +628,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));
         }
     }
@@ -645,7 +645,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));
             }
         }
@@ -662,7 +662,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();
@@ -691,11 +691,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);
         }
     }
@@ -705,7 +705,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;
         }
 
@@ -715,7 +715,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;
                 }
 
@@ -728,7 +728,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.");
             }
         }
 
@@ -740,7 +740,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;
         }
 
@@ -750,7 +750,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;
                 }
 
@@ -759,7 +759,7 @@
                        : new Range(from, to);
             }
             catch (NumberFormatException nfe) {
-                logger.warn("Wrong values for value axis range.");
+                log.warn("Wrong values for value axis range.");
             }
         }
 
@@ -797,7 +797,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;
         }
@@ -817,11 +817,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;
@@ -842,18 +842,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);
         }
@@ -922,7 +922,7 @@
         xaxis.setLabelFont(labelFont);
         xaxis.setTickLabelFont(labelFont);
 
-        logger.debug("Adjusting xAxis. Inverted?: " + inverted);
+        log.debug("Adjusting xAxis. Inverted?: " + inverted);
         if (inverted) {
             xaxis.setInverted(true);
         }
@@ -944,7 +944,7 @@
                 localizeDomainAxis(axis);
             }
             else {
-                logger.warn("Domain axis at " + i + " is null.");
+                log.warn("Domain axis at " + i + " is null.");
             }
         }
 
@@ -955,7 +955,7 @@
                 localizeRangeAxis(axis);
             }
             else {
-                logger.warn("Range axis at " + i + " is null.");
+                log.warn("Range axis at " + i + " is null.");
             }
         }
     }
@@ -1094,7 +1094,7 @@
     @Override
     protected String getDefaultYAxisLabel(String axisName) {
         Set labelSet = axesLabels.get(diagramAttributes.getAxisIndex(axisName));
-        logger.debug("Labels for axis: " + labelSet);
+        log.debug("Labels for axis: " + labelSet);
         if (labelSet != null && !labelSet.isEmpty()) {
             String label = StringUtils.join(labelSet, ", ");
             Matcher units = UNIT_PATTERN.matcher(label);
@@ -1194,11 +1194,11 @@
         /* A conservative security check */
         if (facetName == null || facet == null) {
             /* Can't happen,.. */
-            logger.error("doOut called with null facet.");
+            log.error("doOut called with null facet.");
             return;
         }
 
-        logger.debug("DoOut for facet: " + facetName);
+        log.debug("DoOut for facet: " + facetName);
 
         boolean found = false;
         List<Processor> prL = diagramAttributes.getProcessors();
@@ -1220,11 +1220,11 @@
             }
         }
         if (!found) {
-            logger.warn("No processor found for: " + facetName);
-            if (logger.isDebugEnabled()) {
-                logger.debug("Configured processors for this diagram are:");
+            log.warn("No processor found for: " + facetName);
+            if (log.isDebugEnabled()) {
+                log.debug("Configured processors for this diagram are:");
                 for (Processor pr: prL) {
-                    logger.debug(pr.getClass().getName());
+                    log.debug(pr.getClass().getName());
                 }
             }
         }

http://dive4elements.wald.intevation.org