comparison artifacts/src/main/java/org/dive4elements/river/exports/AxisSection.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 6dfc3a1fc70d
comparison
equal deleted inserted replaced
7596:12c4c8d0ac41 7597:fca46ce8e4f5
19 /** 19 /**
20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 20 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
21 */ 21 */
22 public class AxisSection extends TypeSection { 22 public class AxisSection extends TypeSection {
23 23
24 public static final String IDENTIFIER_ATTR = "id"; 24 public static final String IDENTIFIER_ATTR = "id";
25 public static final String LABEL_ATTR = "label"; 25 public static final String LABEL_ATTR = "label";
26 public static final String FONTSIZE_ATTR = "font-size"; 26 public static final String SUGGESTED_LABEL_ATTR = "suggested-label";
27 public static final String FIXATION_ATTR = "fixation"; 27 public static final String FONTSIZE_ATTR = "font-size";
28 public static final String UPPERRANGE_ATTR = "upper"; 28 public static final String FIXATION_ATTR = "fixation";
29 public static final String LOWERRANGE_ATTR = "lower"; 29 public static final String UPPERRANGE_ATTR = "upper";
30 public static final String LOWERRANGE_ATTR = "lower";
30 31
31 32
32 public AxisSection() { 33 public AxisSection() {
33 super("axis"); 34 super("axis");
34 } 35 }
51 52
52 public String getLabel() { 53 public String getLabel() {
53 return getStringValue(LABEL_ATTR); 54 return getStringValue(LABEL_ATTR);
54 } 55 }
55 56
57
58 public void setSuggestedLabel(String label) {
59 setStringValue(SUGGESTED_LABEL_ATTR, label);
60 }
61
62
63 public String getSuggestedLabel() {
64 return getStringValue(SUGGESTED_LABEL_ATTR);
65 }
56 66
57 public void setFontSize(int fontSize) { 67 public void setFontSize(int fontSize) {
58 if (fontSize <= 0) { 68 if (fontSize <= 0) {
59 return; 69 return;
60 } 70 }

http://dive4elements.wald.intevation.org