Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/AreaArtifact.java @ 7199:baf04164fcc6
issue1435: Stubs for SedimentDensityFacet and -Artifact.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 30 Sep 2013 09:38:09 +0200 |
parents | af13ceeba52a |
children | 8d5ca5175038 |
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 |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import org.apache.log4j.Logger; |
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 import org.w3c.dom.Document; |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
18 import org.dive4elements.artifacts.Artifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
19 import org.dive4elements.artifacts.ArtifactFactory; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
20 import org.dive4elements.artifacts.CallMeta; |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
22 import org.dive4elements.river.artifacts.model.AreaFacet; |
2001
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 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
25 import org.dive4elements.river.artifacts.states.AreaCreationState; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
26 import org.dive4elements.river.artifacts.states.StaticState; |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
28 import org.dive4elements.artifactdatabase.state.Facet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4497
diff
changeset
|
29 import org.dive4elements.artifactdatabase.state.State; |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 |
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 * Artifact describing the area between two WKms. |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 */ |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
35 public class AreaArtifact extends StaticD4EArtifact { |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 /** Name of Artifact. */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 public static final String AREA_ARTIFACT_NAME = "area_artifact"; |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 |
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
|
40 /** 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
|
41 * 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
|
42 * 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
|
43 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
|
44 |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 /** Name of state. */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 public static final String STATIC_STATE_NAME = "state.area_artifact"; |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 /** 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
|
49 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
|
50 |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 /** 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
|
52 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
|
53 |
2033
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
54 /** 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
|
55 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
|
56 |
2010
7f99845e9499
Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2001
diff
changeset
|
57 /** 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
|
58 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
|
59 |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 /** Own logger. */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 private static final Logger logger = |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 Logger.getLogger(AreaArtifact.class); |
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 |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 /** Return given name. */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 @Override |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 public String getName() { |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 return AREA_ARTIFACT_NAME; |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 } |
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 /** Store ids, create an AreaFacet. */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 @Override |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 public void setup( |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 String identifier, |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 ArtifactFactory factory, |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 Object context, |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
78 CallMeta callMeta, |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 Document data) |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 { |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 logger.info("AreaArtifact.setup"); |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 super.setup(identifier, factory, context, callMeta, data); |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
84 |
2010
7f99845e9499
Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2001
diff
changeset
|
85 // 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
|
86 String ids = getDatacageIDValue(data); |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 |
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
|
88 // TODO this facet will be remodeled during next feed. |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 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
|
90 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
|
91 |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 AreaCreationState state = (AreaCreationState) getCurrentState(context); |
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 if (!fs.isEmpty()) { |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
2763
diff
changeset
|
95 addFacets(getCurrentStateId(), fs); |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 } |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 } |
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 // TODO Data is not cached in this way. |
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 /** Do not copy data from daddyfact. */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
102 @Override |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 protected void initialize( |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 Artifact artifact, |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 Object context, |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 CallMeta callMeta) |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 { |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
108 // do nothing |
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 |
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 |
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
|
112 /** |
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
|
113 * 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
|
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 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
|
116 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
|
117 } |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
118 |
2033
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
119 |
2001
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 * 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
|
122 * from the client and store it as data). |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
123 */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
124 public String getLowerDPKey() { |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
125 return getDataAsString(AREA_CURVE_UNDER); |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
126 } |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
127 |
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 /** |
2033
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
130 * 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
|
131 */ |
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
132 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
|
133 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
|
134 |
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
135 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
|
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 |
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 /** |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
140 * 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
|
141 * from the client and store it as data). |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
142 */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
143 public String getUpperDPKey() { |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 return getDataAsString(AREA_CURVE_OVER); |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 } |
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 |
2010
7f99845e9499
Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2001
diff
changeset
|
148 /** 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
|
149 public String getAreaName() { |
7f99845e9499
Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2001
diff
changeset
|
150 return getDataAsString(AREA_NAME); |
7f99845e9499
Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2001
diff
changeset
|
151 } |
7f99845e9499
Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2001
diff
changeset
|
152 |
7f99845e9499
Store and access area.name data item.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2001
diff
changeset
|
153 |
2001
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 * Create and return a new AreaCreationState with charting output. |
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 @Override |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
158 public State getCurrentState(Object cc) { |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
2763
diff
changeset
|
159 final List<Facet> fs = getFacets(getCurrentStateId()); |
2001
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 AreaCreationState state = new AreaCreationState(); |
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 StaticState.addDefaultChartOutput(state, "cross_section", fs); |
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 return state; |
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 |
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 * Get a list containing the one and only State. |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
171 * @param context ignored. |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
172 * @return list with one and only state. |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
173 */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
174 @Override |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
175 protected List<State> getStates(Object context) { |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
176 ArrayList<State> states = new ArrayList<State>(); |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
177 states.add(getCurrentState(context)); |
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 return states; |
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 |
2033
76cedac30d35
Store additional Parameter in AreaArtifact (paint everything between curve a and b?).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2022
diff
changeset
|
182 |
2001
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
183 /** Trivia. */ |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
184 protected State getState(Object context, String stateID) { |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
185 return getCurrentState(null); |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
186 } |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
187 } |
28a5c163f9cd
Added partial area-infrastructure.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
188 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |