diff artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java @ 7597:fca46ce8e4f5

(issue1225) Implement Magic labels. There is now a new value in the chartsettings "Suggested Label" which is hidden in the property editor. A suggested label is the label that combines the label's of all processors that wrote data to an axis. This suggested label is set as the label when the user has not overwritten the label.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 25 Nov 2013 14:58:14 +0100
parents af13ceeba52a
children e4606eae8ea5
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java	Mon Nov 25 14:53:50 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartSettings.java	Mon Nov 25 14:58:14 2013 +0100
@@ -211,14 +211,16 @@
         String fixation = XMLUtils.xpathString(axis, "fixation", null);
         String low      = XMLUtils.xpathString(axis, "lower", null);
         String up       = XMLUtils.xpathString(axis, "upper", null);
+        String sugLabel = XMLUtils.xpathString(axis, "suggested-label", null);
 
         if (logger.isDebugEnabled()) {
-            logger.debug("Fount axis id:        '" + id + "'");
-            logger.debug("Fount axis label:     '" + label + "'");
-            logger.debug("Fount axis font size: '" + fSize + "'");
-            logger.debug("Fount axis fixation:  '" + fixation + "'");
-            logger.debug("Fount axis lower:     '" + low + "'");
-            logger.debug("Fount axis upper:     '" + up + "'");
+            logger.debug("Found axis id:        '" + id + "'");
+            logger.debug("Found axis label:     '" + label + "'");
+            logger.debug("Found axis font size: '" + fSize + "'");
+            logger.debug("Found axis fixation:  '" + fixation + "'");
+            logger.debug("Found axis lower:     '" + low + "'");
+            logger.debug("Found axis upper:     '" + up + "'");
+            logger.debug("Found axis sug. label:'" + sugLabel + "'");
         }
 
         section.setIdentifier(id);
@@ -227,6 +229,7 @@
         section.setFixed(Boolean.valueOf(fixation));
         section.setLowerRange(Double.parseDouble(low.length() > 0 ? low : "0"));
         section.setUpperRange(Double.parseDouble(up.length() > 0 ? up : "0"));
+        section.setSuggestedLabel(sugLabel);
 
         target.addAxisSection(section);
     }

http://dive4elements.wald.intevation.org