annotate artifacts/src/main/java/org/dive4elements/river/artifacts/AreaArtifact.java @ 9801:1d7a72a50183 3.2.x tip

Assume Compose V2, consistently
author Tom Gottfried <tom@intevation.de>
date Thu, 23 Nov 2023 10:14:13 +0100
parents 0a5239a1e46e
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: 5867
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: 5867
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: 4497
diff changeset
9 package org.dive4elements.river.artifacts;
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11 import java.util.ArrayList;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 import java.util.List;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
14 import org.apache.logging.log4j.Logger;
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
15 import org.apache.logging.log4j.LogManager;
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17 import org.w3c.dom.Document;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
19 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
20 import org.dive4elements.artifacts.ArtifactFactory;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
21 import org.dive4elements.artifacts.CallMeta;
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
23 import org.dive4elements.river.artifacts.model.AreaFacet;
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
26 import org.dive4elements.river.artifacts.states.AreaCreationState;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
27 import org.dive4elements.river.artifacts.states.StaticState;
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
29 import org.dive4elements.artifactdatabase.state.Facet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4497
diff changeset
30 import org.dive4elements.artifactdatabase.state.State;
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
33 /**
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34 * Artifact describing the area between two WKms.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35 */
5867
59ff03ff48f1 River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
36 public class AreaArtifact extends StaticD4EArtifact {
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 /** Name of Artifact. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39 public static final String AREA_ARTIFACT_NAME = "area_artifact";
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40
2018
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
41 /** Dataitem: Facet name. Facets with this name will be created (important
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
42 * to not have the area calculated in e.g. a CrossSection to be shown in
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
43 * LongitudinalSection. */
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
44 protected static final String FACET_NAME = "area.facet";
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
45
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
46 /** Name of state. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 public static final String STATIC_STATE_NAME = "state.area_artifact";
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
49 /** data item name to access upper curve. */
2018
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
50 protected static final String AREA_CURVE_OVER = "area.curve_over";
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52 /** data item name to access lower curve. */
2018
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
53 protected static final String AREA_CURVE_UNDER = "area.curve_under";
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
55 /** data item name to access whether or not paint over and under. */
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
56 protected static final String AREA_BETWEEN = "area.between";
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
57
2010
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
58 /** Name of state. */
2018
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
59 protected static final String AREA_NAME = "area.name";
2010
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
60
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
61 /** Own log. */
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
62 private static final Logger log =
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
63 LogManager.getLogger(AreaArtifact.class);
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
65
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66 /** Return given name. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
67 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 public String getName() {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69 return AREA_ARTIFACT_NAME;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
71
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
72
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
73 /** Store ids, create an AreaFacet. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
74 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
75 public void setup(
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
76 String identifier,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
77 ArtifactFactory factory,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
78 Object context,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
79 CallMeta callMeta,
7842
8d5ca5175038 Updated signature of artifacts setup method; Removed unnecessary setup overrides.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
80 Document data,
8d5ca5175038 Updated signature of artifacts setup method; Removed unnecessary setup overrides.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
81 List<Class> loadFacets)
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
82 {
8202
e4606eae8ea5 sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents: 7842
diff changeset
83 log.info("AreaArtifact.setup");
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
84
7842
8d5ca5175038 Updated signature of artifacts setup method; Removed unnecessary setup overrides.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
85 super.setup(identifier, factory, context, callMeta, data, loadFacets);
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
86
2010
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
87 // TODO yet unused.
2741
0251393f037c Refactor usage of now static xpath, other artifacts will follow in later commits.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2740
diff changeset
88 String ids = getDatacageIDValue(data);
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
89
2018
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
90 // TODO this facet will be remodeled during next feed.
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
91 List<Facet> fs = new ArrayList<Facet>();
2018
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
92 fs.add(new AreaFacet(0, "", "TODO: I am an AreaFacet"));
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
93
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
94 AreaCreationState state = (AreaCreationState) getCurrentState(context);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
95
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
96 if (!fs.isEmpty()) {
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 2763
diff changeset
97 addFacets(getCurrentStateId(), fs);
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
98 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
99 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
100
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
101 // TODO Data is not cached in this way.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
102
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
103 /** Do not copy data from daddyfact. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
104 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
105 protected void initialize(
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
106 Artifact artifact,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
107 Object context,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
108 CallMeta callMeta)
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
109 {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
110 // do nothing
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
111 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
112
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
113
2018
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
114 /**
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
115 * Get name of facets to create.
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
116 */
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
117 public String getFacetName() {
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
118 return getDataAsString(FACET_NAME);
3f1a63da2cf4 Prepare ability to paint areas in longitudinal section diagrams, too (next to CrossSection diagrams).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2010
diff changeset
119 }
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
120
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
121
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
122 /**
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
123 * Get dataprovider key for the 'lower' curve (we got that information fed
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
124 * from the client and store it as data).
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
125 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
126 public String getLowerDPKey() {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
127 return getDataAsString(AREA_CURVE_UNDER);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
128 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
129
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
130
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
131 /**
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
132 * True if the whole area between the two curves shall be filled.
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
133 */
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
134 public boolean getPaintBetween() {
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
135 String val = getDataAsString(AREA_BETWEEN);
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
136
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
137 return val != null && val.equals("true");
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
138 }
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
139
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
140
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
141 /**
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
142 * Get dataprovider key for the 'upper' curve (we got that information fed
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
143 * from the client and store it as data).
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
144 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
145 public String getUpperDPKey() {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
146 return getDataAsString(AREA_CURVE_OVER);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
147 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
148
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
149
2010
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
150 /** Return data item that is used to configure name of area. */
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
151 public String getAreaName() {
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
152 return getDataAsString(AREA_NAME);
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
153 }
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
154
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
155
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
156 /**
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
157 * Create and return a new AreaCreationState with charting output.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
158 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
159 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
160 public State getCurrentState(Object cc) {
4497
a2735a4bf75e Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents: 2763
diff changeset
161 final List<Facet> fs = getFacets(getCurrentStateId());
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
162
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
163 AreaCreationState state = new AreaCreationState();
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
164
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
165 StaticState.addDefaultChartOutput(state, "cross_section", fs);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
166
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
167 return state;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
168 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
169
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
170
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
171 /**
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
172 * Get a list containing the one and only State.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
173 * @param context ignored.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
174 * @return list with one and only state.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
175 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
176 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
177 protected List<State> getStates(Object context) {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
178 ArrayList<State> states = new ArrayList<State>();
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
179 states.add(getCurrentState(context));
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
180
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
181 return states;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
182 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
183
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
184
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
185 /** Trivia. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
186 protected State getState(Object context, String stateID) {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
187 return getCurrentState(null);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
188 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
189 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
190 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org