Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/TypeSection.java @ 9601:8f59aa01c22a
Fixed some warnings
author | gernotbelger |
---|---|
date | Tue, 12 Feb 2019 14:06:27 +0100 |
parents | 1cc7653ca84f |
children |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3650
diff
changeset
|
9 package org.dive4elements.river.exports; |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
11 import org.apache.log4j.Logger; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
12 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3650
diff
changeset
|
13 import org.dive4elements.artifactdatabase.state.Attribute; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
3650
diff
changeset
|
14 import org.dive4elements.artifactdatabase.state.DefaultSection; |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 /** |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 * @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
|
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 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
|
21 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
22 private static final Logger log = Logger.getLogger(TypeSection.class); |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
23 |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 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
|
25 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
|
26 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
3650
cbe2febe30cc
Merged revisions 5391-5392 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3615
diff
changeset
|
29 /** Set a string value for a attribute with additional (choice) type. */ |
8856 | 30 public void setChoiceStringValue( |
31 String key, | |
32 String value, | |
33 String choiceType | |
34 ) { | |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
35 if (value == null || value.length() == 0) { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
36 return; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
37 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
38 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
39 Attribute attr = getAttribute(key); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
40 if (attr == null) { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
41 attr = new ChoiceStringAttribute(key, value, true, choiceType); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
42 addAttribute(key, attr); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
43 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
44 else { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
45 attr.setValue(value); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
46 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
47 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
48 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
49 |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 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
|
51 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
|
52 return; |
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 |
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 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
|
57 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
|
58 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
|
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 else { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 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
|
62 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 } |
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 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
|
67 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
|
68 |
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 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
|
70 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
|
71 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
73 log.debug("attribute " + key + " not found in typesection.getString"); |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2056
diff
changeset
|
74 |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 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
|
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 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
|
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 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
|
82 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
|
83 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
|
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 else { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 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
|
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 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
|
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 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 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
|
95 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
|
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 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 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
|
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 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
|
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 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
|
106 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
|
107 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
|
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 else { |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
110 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
|
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 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
115 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
|
116 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
|
117 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 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
|
119 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
|
120 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
122 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
|
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 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
126 protected final void setBooleanValue(String key, boolean value) { |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
127 final Attribute attr = getAttribute(key); |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
128 if (attr == null) |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
129 addAttribute(key, new BooleanAttribute(key, value, true)); |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
130 else |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
131 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
|
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 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
134 protected final boolean getBooleanValue(final String key, boolean defaultValue) { |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
135 final Attribute attr = getAttribute(key); |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 if (attr instanceof BooleanAttribute) { |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
138 final Boolean value = (Boolean) attr.getValue(); |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
139 if( value == null ) |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
140 return defaultValue; |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
141 |
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
142 return value; |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
143 } |
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
144 |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
145 return defaultValue; |
2056
76eeb3b4358e
Added an ExportSection to ChartSettings which provides attributes for chart 'width' and 'height'.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
146 } |
9123
1cc7653ca84f
Cleanup of ChartGenerator and ChartGenerator2 code. Put some of the copy/pasted code into a common abstraction.
gernotbelger
parents:
8856
diff
changeset
|
147 } |