Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/exports/TypeSection.java @ 5591:55d6c5cac9d1
Added new elements to M-INFO datacage.
* New macros for density, porosity and flow velocity.
* Added annotations to 'Sohlbeschaffenheit'.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Mon, 08 Apr 2013 14:52:59 +0200 |
parents | cbe2febe30cc |
children |
rev | line source |
---|---|
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.exports; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
3 import org.apache.log4j.Logger; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
4 |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import de.intevation.artifactdatabase.state.Attribute; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 import de.intevation.artifactdatabase.state.DefaultSection; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 /** |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 */ |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 public class TypeSection extends DefaultSection { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
14 private static final Logger logger = Logger.getLogger(TypeSection.class); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
15 |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 public TypeSection(String key) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 super(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 |
3650
cbe2febe30cc
Merged revisions 5391-5392 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3615
diff
changeset
|
21 /** Set a string value for a attribute with additional (choice) type. */ |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
22 public void setChoiceStringValue(String key, String value, String choiceType) { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
23 if (value == null || value.length() == 0) { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
24 return; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
25 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
26 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
27 Attribute attr = getAttribute(key); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
28 if (attr == null) { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
29 attr = new ChoiceStringAttribute(key, value, true, choiceType); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
30 addAttribute(key, attr); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
31 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
32 else { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
33 attr.setValue(value); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
34 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
35 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
36 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
37 |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 public void setStringValue(String key, String value) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 if (value == null || value.length() == 0) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 return; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 if (attr == null) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 attr = new StringAttribute(key, value, true); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 addAttribute(key, attr); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 else { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 attr.setValue(value); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 public String getStringValue(String key) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 if (attr instanceof StringAttribute) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 return (String) attr.getValue(); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
61 logger.debug("attribute " + key + " not found in typesection.getString"); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
62 |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 return null; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 public void setIntegerValue(String key, int value) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 if (attr == null) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 attr = new IntegerAttribute(key, value, true); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 addAttribute(key, attr); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 else { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 attr.setValue(value); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 public Integer getIntegerValue(String key) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 if (attr instanceof IntegerAttribute) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 return (Integer) attr.getValue(); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 return null; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 public void setDoubleValue(String key, double value) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 if (attr == null) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 attr = new DoubleAttribute(key, value, true); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 addAttribute(key, attr); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 else { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 attr.setValue(value); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
102 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
103 public Double getDoubleValue(String key) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
104 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
106 if (attr instanceof DoubleAttribute) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
107 return (Double) attr.getValue(); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
108 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 return null; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
111 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
112 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
113 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 public void setBooleanValue(String key, boolean value) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
116 if (attr == null) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 attr = new BooleanAttribute(key, value, true); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 addAttribute(key, attr); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
119 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
120 else { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 attr.setValue(value); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
123 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
125 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
126 public Boolean getBooleanValue(String key) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
127 Attribute attr = getAttribute(key); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
128 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
129 if (attr instanceof BooleanAttribute) { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 return (Boolean) attr.getValue(); |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
132 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
133 return null; |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
134 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |