Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/AxisSection.java @ 1992:e1c9f28e2675
Added more attributes to ChartSettings AxisSection.
flys-artifacts/trunk@3428 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 16 Dec 2011 07:28:17 +0000 |
parents | 0bd7c3cf0af1 |
children | c4e0e433f825 |
comparison
equal
deleted
inserted
replaced
1991:0bd7c3cf0af1 | 1992:e1c9f28e2675 |
---|---|
14 */ | 14 */ |
15 public class AxisSection extends DefaultSection { | 15 public class AxisSection extends DefaultSection { |
16 | 16 |
17 public static final String IDENTIFIER_ATTR = "id"; | 17 public static final String IDENTIFIER_ATTR = "id"; |
18 public static final String LABEL_ATTR = "label"; | 18 public static final String LABEL_ATTR = "label"; |
19 public static final String FONTSIZE_ATTR = "font-size"; | |
20 public static final String FIXATION_ATTR = "fixation"; | |
21 public static final String UPPERRANGE_ATTR = "upper"; | |
22 public static final String LOWERRANGE_ATTR = "lower"; | |
19 | 23 |
20 | 24 |
21 public AxisSection() { | 25 public AxisSection() { |
22 super("axis"); | 26 super("axis"); |
23 } | 27 } |
53 attr.setValue(label); | 57 attr.setValue(label); |
54 } | 58 } |
55 } | 59 } |
56 | 60 |
57 | 61 |
62 public void setFontSize(int fontSize) { | |
63 if (fontSize <= 0) { | |
64 return; | |
65 } | |
66 | |
67 Attribute attr = getAttribute(FONTSIZE_ATTR); | |
68 if (attr == null) { | |
69 attr = new IntegerAttribute(FONTSIZE_ATTR, fontSize, true); | |
70 addAttribute(FONTSIZE_ATTR, attr); | |
71 } | |
72 else { | |
73 attr.setValue(fontSize); | |
74 } | |
75 } | |
76 | |
77 | |
78 public void setFixed(boolean fixed) { | |
79 Attribute attr = getAttribute(FIXATION_ATTR); | |
80 if (attr == null) { | |
81 attr = new BooleanAttribute(FIXATION_ATTR, fixed, true); | |
82 addAttribute(FIXATION_ATTR, attr); | |
83 } | |
84 else { | |
85 attr.setValue(fixed); | |
86 } | |
87 } | |
88 | |
89 | |
90 public void setUpperRange(double upperRange) { | |
91 Attribute attr = getAttribute(UPPERRANGE_ATTR); | |
92 if (attr == null) { | |
93 attr = new DoubleAttribute(UPPERRANGE_ATTR, upperRange, true); | |
94 addAttribute(UPPERRANGE_ATTR, attr); | |
95 } | |
96 else { | |
97 attr.setValue(upperRange); | |
98 } | |
99 } | |
100 | |
101 | |
102 public void setLowerRange(double lowerRange) { | |
103 Attribute attr = getAttribute(LOWERRANGE_ATTR); | |
104 if (attr == null) { | |
105 attr = new DoubleAttribute(LOWERRANGE_ATTR, lowerRange, true); | |
106 addAttribute(LOWERRANGE_ATTR, attr); | |
107 } | |
108 else { | |
109 attr.setValue(lowerRange); | |
110 } | |
111 } | |
112 | |
113 | |
58 @Override | 114 @Override |
59 public void toXML(Node parent) { | 115 public void toXML(Node parent) { |
60 Document owner = parent.getOwnerDocument(); | 116 Document owner = parent.getOwnerDocument(); |
61 Element axis = owner.createElement("axis"); | 117 Element axis = owner.createElement("axis"); |
62 | 118 |