Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/AxisSection.java @ 1991:0bd7c3cf0af1
Added axis sections into charts Settings.
flys-artifacts/trunk@3427 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 15 Dec 2011 17:10:42 +0000 |
parents | 3632150dbe0b |
children | e1c9f28e2675 |
comparison
equal
deleted
inserted
replaced
1990:5c1e7c1e9e09 | 1991:0bd7c3cf0af1 |
---|---|
12 /** | 12 /** |
13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 13 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
14 */ | 14 */ |
15 public class AxisSection extends DefaultSection { | 15 public class AxisSection extends DefaultSection { |
16 | 16 |
17 public AxisSection(String id) { | 17 public static final String IDENTIFIER_ATTR = "id"; |
18 super(id); | 18 public static final String LABEL_ATTR = "label"; |
19 | |
20 | |
21 public AxisSection() { | |
22 super("axis"); | |
23 } | |
24 | |
25 | |
26 public void setIdentifier(String identifier) { | |
27 if (identifier == null || identifier.length() == 0) { | |
28 return; | |
29 } | |
30 | |
31 Attribute attr = getAttribute(IDENTIFIER_ATTR); | |
32 if (attr == null) { | |
33 attr = new StringAttribute(IDENTIFIER_ATTR, identifier, false); | |
34 addAttribute(IDENTIFIER_ATTR, attr); | |
35 } | |
36 else { | |
37 attr.setValue(identifier); | |
38 } | |
39 } | |
40 | |
41 | |
42 public void setLabel(String label) { | |
43 if (label == null) { | |
44 return; | |
45 } | |
46 | |
47 Attribute attr = getAttribute(LABEL_ATTR); | |
48 if (attr == null) { | |
49 attr = new StringAttribute(LABEL_ATTR, label, true); | |
50 addAttribute(LABEL_ATTR, attr); | |
51 } | |
52 else { | |
53 attr.setValue(label); | |
54 } | |
19 } | 55 } |
20 | 56 |
21 | 57 |
22 @Override | 58 @Override |
23 public void toXML(Node parent) { | 59 public void toXML(Node parent) { |