Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/exports/ChoiceStringAttribute.java @ 7597:fca46ce8e4f5
(issue1225) Implement Magic labels.
There is now a new value in the chartsettings "Suggested Label" which
is hidden in the property editor. A suggested label is the label that
combines the label's of all processors that wrote data to an axis.
This suggested label is set as the label when the user has not
overwritten the label.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 25 Nov 2013 14:58:14 +0100 |
parents | af13ceeba52a |
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:
4051
diff
changeset
|
9 package org.dive4elements.river.exports; |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import org.w3c.dom.Element; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 import org.w3c.dom.Node; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 /** |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 */ |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 public class ChoiceStringAttribute extends StringAttribute { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 /** Indicator which type of choice is dealt with. */ |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 protected String choiceType; |
3633
ebfce31c7eec
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3615
diff
changeset
|
22 |
3615
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 public ChoiceStringAttribute(String name, |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 String value, |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 boolean visible, |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 String choiceType) { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 super(name, value, visible); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 this.choiceType = choiceType; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 /** |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 * Calls VisibleAttribute.toXML() and appends afterwards an attribute |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 * <i>type</i> with value <i>string</i>. |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 * |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 * @param parent The parent Node. |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 * |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 * @return the new Node that represents this Attribute. |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
40 */ |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 @Override |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 public Node toXML(Node parent) { |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 Element ele = (Element) super.toXML(parent); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 ele.setAttribute("type", "string"); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 ele.setAttribute("choice", choiceType); |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 return ele; |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 } |
f84854eba0b3
Preparations for logo inclusion in charts.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |