Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/ManualPointsArtifact.java @ 5546:5b50247d4d99
Use latin1 as encoding in the dgm importer to make it easier matching latin1
csv values
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Thu, 04 Apr 2013 10:23:17 +0200 |
parents | a2735a4bf75e |
children |
rev | line source |
---|---|
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
3 import java.awt.geom.Point2D; |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 import java.util.ArrayList; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 import java.util.List; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 import org.apache.log4j.Logger; |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
8 import org.json.JSONArray; |
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
9 import org.json.JSONException; |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 import org.w3c.dom.Document; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifactdatabase.state.Facet; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.Artifact; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.ArtifactFactory; |
4478
6153c50f78cf
WaterLineArtifact: Added callcontext-parameter to interfaces getWaterLine.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3761
diff
changeset
|
15 import de.intevation.artifacts.CallContext; |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.artifacts.CallMeta; |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
17 import de.intevation.flys.artifacts.geom.Lines; |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.flys.artifacts.model.FacetTypes; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 import de.intevation.flys.artifacts.states.DefaultState; |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
20 import de.intevation.flys.model.FastCrossSectionLine; |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
21 |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 /** |
3225
049ccd2c5935
Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3198
diff
changeset
|
24 * Artifact to store user-added points and water lines. |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 */ |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 public class ManualPointsArtifact |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 extends StaticFLYSArtifact |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
28 implements FacetTypes, WaterLineArtifact |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 { |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
30 private static final long serialVersionUID = 7096025125474986011L; |
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
31 |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 /** The logger for this class. */ |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 private static Logger logger = Logger.getLogger(ManualPointsArtifact.class); |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 /** The name of the artifact. */ |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 public static final String ARTIFACT_NAME = "manualpoints"; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 public ManualPointsArtifact() { |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2173
diff
changeset
|
40 logger.debug("ManualPointsArtifact.ManualPointsArtifact()"); |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
41 } |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
42 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 /** |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
45 * Gets called from factory to set things up. |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 */ |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 @Override |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 public void setup( |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
49 String identifier, |
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
50 ArtifactFactory factory, |
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
51 Object context, |
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
52 CallMeta callMeta, |
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
53 Document data) |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 { |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 logger.debug("ManualPointsArtifact.setup"); |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
56 super.setup(identifier, factory, context, callMeta, data); |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 initialize(null, context, callMeta); |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 } |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
61 /** Return the name of this artifact. */ |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
62 @Override |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 public String getName() { |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 return ARTIFACT_NAME; |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 } |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
66 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
67 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 /** Access state data storing the jsonstring with points. */ |
2206
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2173
diff
changeset
|
69 public String getPointsData(String facetName) { |
e2124ca11adb
Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
2173
diff
changeset
|
70 return getDataAsString(facetName + ".data"); |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 } |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
74 /** |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
75 * Access state data storing the jsonstring with lines. |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
76 * @param facetName Name of facet or null if the so far |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
77 * only known case should be picked. |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
78 * @return (String) value of data element (expect json). |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
79 */ |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
80 public String getLinesData(String facetName) { |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
81 if (facetName == null) |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
82 return getDataAsString("cross_section.manualpoints.lines"); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
83 // TODO .lineS? |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
84 return getDataAsString(facetName + ".line"); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
85 } |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
86 |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
87 |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
88 /** Setup state and facet. */ |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 @Override |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 protected void initialize(Artifact artifact, Object context, CallMeta meta) { |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
91 logger.debug("ManualPointsArtifact.initialize"); |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 List<Facet> fs = new ArrayList<Facet>(); |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 DefaultState state = (DefaultState) getCurrentState(context); |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 state.computeInit(this, hash(), context, meta, fs); |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2206
diff
changeset
|
96 if (!fs.isEmpty()) { |
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2206
diff
changeset
|
97 logger.debug("Facets to add in ManualPointsArtifact.initialize ."); |
4497
a2735a4bf75e
Change facets member variable to private
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4478
diff
changeset
|
98 addFacets(getCurrentStateId(), fs); |
3076
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2206
diff
changeset
|
99 } |
5642a83420f2
FLYS artifacts: Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2206
diff
changeset
|
100 else { |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
101 logger.debug("No facets to add in ManualPointsArtifact.initialize (" |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
102 + state.getID() + ")."); |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
103 } |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
104 } |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
105 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
106 |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
107 /** |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
108 * Get value of line at index. |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
109 * @param index index in json array defining lines. |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
110 * @return water height of line at given index. |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
111 */ |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
112 protected double getLine(int index) { |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
113 try { |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
114 JSONArray lines = new JSONArray(getLinesData(null)); |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
115 JSONArray array = lines.getJSONArray(index); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
116 |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
117 return array.getDouble(0); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
118 } |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
119 catch(JSONException e){ |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
120 logger.error("Could not decode json for line."); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
121 return 0d; |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
122 } |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
123 } |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
124 |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
125 |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
126 /** |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
127 * Get the water line "surface". |
3272
31168ac9c7e7
Partial fix for issue694 (heightmarks snap to nearest cross section).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3227
diff
changeset
|
128 * @param index index of facets data. |
3284
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3272
diff
changeset
|
129 * @param csl 'ground' against which to determine water surface. |
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3272
diff
changeset
|
130 * @param a (ignored in this implementation). |
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3272
diff
changeset
|
131 * @param b (ignored in this implementation). |
4478
6153c50f78cf
WaterLineArtifact: Added callcontext-parameter to interfaces getWaterLine.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3761
diff
changeset
|
132 * @param context (ignored in this implementation). |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
133 */ |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
134 @Override |
3284
d9af29a4bb85
Various cosmetic doc fixes.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3272
diff
changeset
|
135 public Lines.LineData getWaterLines( |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
136 int index, |
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
137 FastCrossSectionLine csl, |
4478
6153c50f78cf
WaterLineArtifact: Added callcontext-parameter to interfaces getWaterLine.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3761
diff
changeset
|
138 double a, double b, |
6153c50f78cf
WaterLineArtifact: Added callcontext-parameter to interfaces getWaterLine.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3761
diff
changeset
|
139 CallContext context |
3761
066e2b4d69ca
Fix missing import
Christian Lins <christian.lins@intevation.de>
parents:
3556
diff
changeset
|
140 ) { |
3198
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
141 List<Point2D> points = csl.getPoints(); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
142 return Lines.createWaterLines(points, getLine(index)); |
d35f28655fa6
Create and handle new manual line type facets.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3076
diff
changeset
|
143 } |
2172
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
144 } |
3ecc76ef25a9
New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
145 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |