annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/BedHeightsArtifact.java @ 4654:861c47e0a8a0

Refactor Mapserver mapfile generation. Prepares the existing mapfile generation code for a river axis mapfile generator. Removes unused asynchronous mapfile generation to reduce complexity.
author Christian Lins <christian.lins@intevation.de>
date Sat, 08 Dec 2012 00:19:29 +0100
parents b838d16c629e
children cd44d28d0fbc
rev   line source
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
2
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
4 import java.util.List;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
5
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
6 import org.apache.log4j.Logger;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
7 import org.w3c.dom.Document;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
8
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
9 import de.intevation.artifactdatabase.state.DefaultOutput;
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10 import de.intevation.artifactdatabase.state.Facet;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
11 import de.intevation.artifactdatabase.state.FacetActivity;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
12 import de.intevation.artifacts.ArtifactFactory;
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
13 import de.intevation.artifacts.Artifact;
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 import de.intevation.artifacts.CallMeta;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 import de.intevation.artifacts.common.utils.XMLUtils;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 import de.intevation.flys.artifacts.model.minfo.BedHeight;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 import de.intevation.flys.artifacts.model.minfo.BedHeightFacet;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 import de.intevation.flys.artifacts.model.minfo.BedHeightFactory;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
19 import de.intevation.flys.artifacts.states.StaticState;
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
20 import de.intevation.flys.model.BedHeightSingle;
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
21 import de.intevation.flys.model.BedHeightSingleValue;
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 public class BedHeightsArtifact
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
24 extends AbstractStaticStateArtifact
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
25 {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 /** The logger for this class. */
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27 private static Logger logger =
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28 Logger.getLogger(BedHeightsArtifact.class);
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 private static final String NAME = "bedheights";
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
31 private static final String STATIC_FACET_NAME = "bedheight";
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
32
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 static {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34 // TODO: Move to configuration.
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 FacetActivity.Registry.getInstance()
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 .register(NAME, FacetActivity.INACTIVE);
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 }
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 public static final String STATIC_STATE_NAME =
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 "state.additional_bedheights.static";
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 /** Data Item name to know whether we are Heighmarks and reveive
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 * some data slightly different. */
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
44 public static final String DATA_HEIGHT_TYPE =
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
45 "height_marks";
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47 /**
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 * Trivial Constructor.
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 */
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 public BedHeightsArtifact() {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 logger.debug("BedHeightsArtifact.BedHeightsArtifact");
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
52 }
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
53
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
54 @Override
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
55 public String getName() {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
56 return NAME;
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
57 }
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
58
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
59 /**
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
60 * Gets called from factory, to set things up.
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
61 */
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
62 @Override
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
63 public void setup(
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
64 String identifier,
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
65 ArtifactFactory factory,
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
66 Object context,
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
67 CallMeta callMeta,
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
68 Document data)
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
69 {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
70 logger.debug("BedHeightsArtifact.setup");
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
71
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
72 if (logger.isDebugEnabled()) {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 logger.debug(XMLUtils.toString(data));
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
74 }
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
75
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
76 String code = getDatacageIDValue(data);
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
77
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 if (code != null) {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
79 String [] parts = code.split("-");
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
80
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
81 if (parts.length >= 4) {
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
82 String name = parts[0];
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
83 String type = parts[1];
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
84 String btype = type;
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
85 int hId = Integer.parseInt(parts[2]);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
86 if (name.equals("bedheight")) {
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
87 addStringData("type", type);
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
88 addStringData("height_id", parts[2]);
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
89 addStringData("time", parts[3]);
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
90 }
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
91 if (type.equals("singlevalues")) {
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
92 btype = "single";
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
93 }
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
94
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
95 String bedHName = BedHeightFactory.getHeightName(btype, hId);
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
96
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
97 Facet facet = new BedHeightFacet(
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
98 STATIC_FACET_NAME, bedHName, type);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
99
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
100 ArrayList<Facet> facets = new ArrayList<Facet>(1);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
101 facets.add(facet);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
102
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
103 addFacets(STATIC_STATE_NAME, facets);
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
104 }
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
105 }
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
106 super.setup(identifier, factory, context, callMeta, data);
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
107 }
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
108
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
109 /**
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
110 */
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
111 public BedHeight getHeight() {
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
112 return BedHeightFactory.getHeight(
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
113 getDataAsString("type"),
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
114 Integer.parseInt(getDataAsString("height_id")),
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
115 Integer.parseInt(getDataAsString("time")));
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
116 }
4535
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
117
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
118 public List<BedHeightSingleValue> getSingleValues() {
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
119 logger.debug("getSingleValues");
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
120 BedHeightSingle single = BedHeightSingle.getBedHeightSingleById(
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
121 getDataAsInteger("height_id"));
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
122 return BedHeightSingleValue.getBedHeightSingleValues(single,
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
123 getDataAsDouble("ld_from"),
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
124 getDataAsDouble("ld_to"));
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
125 }
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
126
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
127 @Override
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
128 protected void initStaticState() {
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
129
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
130 logger.debug("initStaticState " + getName() + " " + identifier());
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
131
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
132 StaticState state = new StaticState(STATIC_STATE_NAME);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
133 DefaultOutput output = new DefaultOutput(
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
134 "general",
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
135 "general",
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
136 "image/png",
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
137 "chart");
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
138
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
139 List<Facet> facets = getFacets(STATIC_STATE_NAME);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
140 output.addFacets(facets);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
141 state.addOutput(output);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
142
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
143 setStaticState(state);
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
144 }
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
145
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
146 @Override
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
147 protected void initialize(Artifact artifact, Object context, CallMeta meta) {
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
148 // do not clone facets, etc. from master artifact
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
149
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
150 logger.debug("initialize");
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
151 importData((FLYSArtifact)artifact, "ld_from");
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
152 importData((FLYSArtifact)artifact, "ld_to");
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
153
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
154 logger.debug("ld_from " + getDataAsString("ld_from"));
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
155 logger.debug("ld_to " + getDataAsString("ld_to"));
b838d16c629e Refactor BedHeightArtifacts to provide bed height single values of a range
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4502
diff changeset
156 }
3614
68beaa827751 MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
157 }
4459
d83e021ff638 BedHeightArtifact: Whitespace-cosmetic and vim line.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3774
diff changeset
158 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org