comparison flys-artifacts/src/main/java/de/intevation/flys/exports/AxisSection.java @ 3318:dbe2f85bf160

merged flys-artifacts/2.8
author Thomas Arendsen Hein <thomas@intevation.de>
date Fri, 28 Sep 2012 12:14:35 +0200
parents ca8997aa683e
children
comparison
equal deleted inserted replaced
2987:98c7a46ec5ae 3318:dbe2f85bf160
1 package de.intevation.flys.exports;
2
3
4 import org.w3c.dom.Document;
5 import org.w3c.dom.Element;
6 import org.w3c.dom.Node;
7
8 import de.intevation.artifactdatabase.state.Attribute;
9
10
11 /**
12 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
13 */
14 public class AxisSection extends TypeSection {
15
16 public static final String IDENTIFIER_ATTR = "id";
17 public static final String LABEL_ATTR = "label";
18 public static final String FONTSIZE_ATTR = "font-size";
19 public static final String FIXATION_ATTR = "fixation";
20 public static final String UPPERRANGE_ATTR = "upper";
21 public static final String LOWERRANGE_ATTR = "lower";
22
23
24 public AxisSection() {
25 super("axis");
26 }
27
28
29 public void setIdentifier(String identifier) {
30 setStringValue(IDENTIFIER_ATTR, identifier);
31 }
32
33
34 public String getIdentifier() {
35 return getStringValue(IDENTIFIER_ATTR);
36 }
37
38
39 public void setLabel(String label) {
40 setStringValue(LABEL_ATTR, label);
41 }
42
43
44 public String getLabel() {
45 return getStringValue(LABEL_ATTR);
46 }
47
48
49 public void setFontSize(int fontSize) {
50 if (fontSize <= 0) {
51 return;
52 }
53
54 setIntegerValue(FONTSIZE_ATTR, fontSize);
55 }
56
57
58 public Integer getFontSize() {
59 return getIntegerValue(FONTSIZE_ATTR);
60 }
61
62
63 public void setFixed(boolean fixed) {
64 setBooleanValue(FIXATION_ATTR, fixed);
65 }
66
67
68 public Boolean isFixed() {
69 return getBooleanValue(FIXATION_ATTR);
70 }
71
72
73 public void setUpperRange(double upperRange) {
74 setDoubleValue(UPPERRANGE_ATTR, upperRange);
75 }
76
77
78 public Double getUpperRange() {
79 return getDoubleValue(UPPERRANGE_ATTR);
80 }
81
82
83 public void setLowerRange(double lowerRange) {
84 setDoubleValue(LOWERRANGE_ATTR, lowerRange);
85 }
86
87
88 public Double getLowerRange() {
89 return getDoubleValue(LOWERRANGE_ATTR);
90 }
91
92
93 @Override
94 public void toXML(Node parent) {
95 Document owner = parent.getOwnerDocument();
96 Element axis = owner.createElement("axis");
97
98 parent.appendChild(axis);
99
100 for (String key: getKeys()) {
101 Attribute attr = getAttribute(key);
102 attr.toXML(axis);
103 }
104 }
105 }
106 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org