comparison 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
comparison
equal deleted inserted replaced
7596:12c4c8d0ac41 7597:fca46ce8e4f5
209 String label = XMLUtils.xpathString(axis, "label", null); 209 String label = XMLUtils.xpathString(axis, "label", null);
210 String fSize = XMLUtils.xpathString(axis, "font-size", null); 210 String fSize = XMLUtils.xpathString(axis, "font-size", null);
211 String fixation = XMLUtils.xpathString(axis, "fixation", null); 211 String fixation = XMLUtils.xpathString(axis, "fixation", null);
212 String low = XMLUtils.xpathString(axis, "lower", null); 212 String low = XMLUtils.xpathString(axis, "lower", null);
213 String up = XMLUtils.xpathString(axis, "upper", null); 213 String up = XMLUtils.xpathString(axis, "upper", null);
214 String sugLabel = XMLUtils.xpathString(axis, "suggested-label", null);
214 215
215 if (logger.isDebugEnabled()) { 216 if (logger.isDebugEnabled()) {
216 logger.debug("Fount axis id: '" + id + "'"); 217 logger.debug("Found axis id: '" + id + "'");
217 logger.debug("Fount axis label: '" + label + "'"); 218 logger.debug("Found axis label: '" + label + "'");
218 logger.debug("Fount axis font size: '" + fSize + "'"); 219 logger.debug("Found axis font size: '" + fSize + "'");
219 logger.debug("Fount axis fixation: '" + fixation + "'"); 220 logger.debug("Found axis fixation: '" + fixation + "'");
220 logger.debug("Fount axis lower: '" + low + "'"); 221 logger.debug("Found axis lower: '" + low + "'");
221 logger.debug("Fount axis upper: '" + up + "'"); 222 logger.debug("Found axis upper: '" + up + "'");
223 logger.debug("Found axis sug. label:'" + sugLabel + "'");
222 } 224 }
223 225
224 section.setIdentifier(id); 226 section.setIdentifier(id);
225 section.setLabel(label); 227 section.setLabel(label);
226 section.setFontSize(Integer.parseInt(fSize.length() > 0 ? fSize : "-1")); 228 section.setFontSize(Integer.parseInt(fSize.length() > 0 ? fSize : "-1"));
227 section.setFixed(Boolean.valueOf(fixation)); 229 section.setFixed(Boolean.valueOf(fixation));
228 section.setLowerRange(Double.parseDouble(low.length() > 0 ? low : "0")); 230 section.setLowerRange(Double.parseDouble(low.length() > 0 ? low : "0"));
229 section.setUpperRange(Double.parseDouble(up.length() > 0 ? up : "0")); 231 section.setUpperRange(Double.parseDouble(up.length() > 0 ? up : "0"));
232 section.setSuggestedLabel(sugLabel);
230 233
231 target.addAxisSection(section); 234 target.addAxisSection(section);
232 } 235 }
233 236
234 237

http://dive4elements.wald.intevation.org