annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/AreaArtifact.java @ 4431:83fe6eeba83a

Added vim line.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 07 Nov 2012 09:44:24 +0100
parents 2f7fed1eb4bf
children a2735a4bf75e
rev   line source
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
2
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
4 import java.util.List;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
5
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
6 import org.apache.log4j.Logger;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
7
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
8 import org.w3c.dom.Document;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
9
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10 import de.intevation.artifacts.Artifact;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
11 import de.intevation.artifacts.ArtifactFactory;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
12 import de.intevation.artifacts.CallMeta;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
14 import de.intevation.flys.artifacts.model.AreaFacet;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
15
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 de.intevation.flys.artifacts.states.AreaCreationState;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18 import de.intevation.flys.artifacts.states.StaticState;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20 import de.intevation.artifactdatabase.state.Facet;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 import de.intevation.artifactdatabase.state.State;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23
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 * Artifact describing the area between two WKms.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27 public class AreaArtifact extends StaticFLYSArtifact {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 /** Name of Artifact. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 public static final String AREA_ARTIFACT_NAME = "area_artifact";
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31
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
32 /** 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
33 * 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
34 * 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
35 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
36
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 /** Name of state. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 public static final String STATIC_STATE_NAME = "state.area_artifact";
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40 /** 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
41 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
42
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 /** 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
44 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
45
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
46 /** 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
47 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
48
2010
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
49 /** 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
50 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
51
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52 /** Own logger. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 private static final Logger logger =
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54 Logger.getLogger(AreaArtifact.class);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
56
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
57 /** Return given name. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
58 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
59 public String getName() {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
60 return AREA_ARTIFACT_NAME;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
63
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64 /** Store ids, create an AreaFacet. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
65 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
66 public void setup(
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
67 String identifier,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 ArtifactFactory factory,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69 Object context,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 CallMeta callMeta,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
71 Document data)
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 logger.info("AreaArtifact.setup");
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
74
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
75 super.setup(identifier, factory, context, callMeta, data);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
76
2010
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
77 // 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
78 String ids = getDatacageIDValue(data);
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
79
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
80 // TODO this facet will be remodeled during next feed.
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
81 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
82 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
83
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
84 AreaCreationState state = (AreaCreationState) getCurrentState(context);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
85
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
86 if (!fs.isEmpty()) {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
87 facets.put(getCurrentStateId(), fs);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
88 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
89 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
90
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
91 // TODO Data is not cached in this way.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
92
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
93 /** Do not copy data from daddyfact. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
94 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
95 protected void initialize(
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
96 Artifact artifact,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
97 Object context,
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
98 CallMeta callMeta)
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 // do nothing
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
101 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
102
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
103
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
104 /**
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
105 * 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
106 */
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
107 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
108 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
109 }
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
110
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
111
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
112 /**
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
113 * 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
114 * from the client and store it as data).
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
115 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
116 public String getLowerDPKey() {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
117 return getDataAsString(AREA_CURVE_UNDER);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
118 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
119
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
120
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
121 /**
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
122 * 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
123 */
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
124 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
125 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
126
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
127 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
128 }
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
129
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
130
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
131 /**
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
132 * 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
133 * from the client and store it as data).
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
134 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
135 public String getUpperDPKey() {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
136 return getDataAsString(AREA_CURVE_OVER);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
137 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
138
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
139
2010
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
140 /** 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
141 public String getAreaName() {
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
142 return getDataAsString(AREA_NAME);
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
143 }
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
144
7f99845e9499 Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2001
diff changeset
145
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
146 /**
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
147 * Create and return a new AreaCreationState with charting output.
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 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
150 public State getCurrentState(Object cc) {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
151 final List<Facet> fs = facets.get(getCurrentStateId());
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
152
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
153 AreaCreationState state = new AreaCreationState();
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
154
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
155 StaticState.addDefaultChartOutput(state, "cross_section", fs);
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 return state;
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
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
160
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
161 /**
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
162 * Get a list containing the one and only State.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
163 * @param context ignored.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
164 * @return list with one and only state.
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
165 */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
166 @Override
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
167 protected List<State> getStates(Object context) {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
168 ArrayList<State> states = new ArrayList<State>();
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
169 states.add(getCurrentState(context));
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 return states;
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
172 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
173
2033
76cedac30d35 Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2022
diff changeset
174
2001
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
175 /** Trivia. */
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
176 protected State getState(Object context, String stateID) {
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
177 return getCurrentState(null);
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
178 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
179 }
28a5c163f9cd Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
180 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org