annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/FlowVelocityMeasurementFacet.java @ 7894:42076d94977e facet-metadata

Added metadata to facets.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 21 May 2014 11:43:10 +0200
parents af13ceeba52a
children 5e38e2924c07
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: 5863
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: 5863
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: 4464
diff changeset
9 package org.dive4elements.river.artifacts.model.minfo;
4452
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4464
diff changeset
11 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4464
diff changeset
12 import org.dive4elements.artifacts.CallContext;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4464
diff changeset
13 import org.dive4elements.river.artifacts.FlowVelocityMeasurementArtifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4464
diff changeset
14 import org.dive4elements.river.artifacts.model.BlackboardDataFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4464
diff changeset
15 import org.dive4elements.river.artifacts.model.FacetTypes;
4452
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
17
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18 /** Facet to show measured flow velocity. */
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
19 public class FlowVelocityMeasurementFacet
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
20 extends BlackboardDataFacet
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21 implements FacetTypes {
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
22
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
23 public FlowVelocityMeasurementFacet(String description) {
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24 this(FLOW_VELOCITY_MEASUREMENT, description);
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
25 }
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
26
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 public FlowVelocityMeasurementFacet(String name, String description) {
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 this.name = name;
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
30 this.description = description;
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
31 this.index = 0;
7894
42076d94977e Added metadata to facets.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
32 this.metaData.put("X", "chart.longitudinal.section.xaxis.label");
42076d94977e Added metadata to facets.
Raimund Renkert <rrenkert@intevation.de>
parents: 5994
diff changeset
33 this.metaData.put("Y", "chart.flow_velocity.section.yaxis.label");
4452
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
34 }
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
35
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
36
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 /**
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
38 * Returns the data this facet requires.
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
39 *
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40 * @param artifact the owner artifact.
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
41 * @param context the CallContext (ignored).
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
42 *
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
43 * @return the data.
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
44 */
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
45 @Override
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
46 public Object getData(Artifact artifact, CallContext context) {
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 FlowVelocityMeasurementArtifact staticData =
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48 (FlowVelocityMeasurementArtifact) artifact;
4464
b66285ece774 For FlowV.-Artifacts, use given id, fetch data and display via facet and generator.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 4452
diff changeset
49 return staticData.getFlowVelocityMeasurementValue();
4452
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
50 }
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 /**
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
54 * Create a deep copy of this Facet.
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55 * @return a deep copy.
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
56 */
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
57 @Override
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
58 public FlowVelocityMeasurementFacet deepCopy() {
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
59 FlowVelocityMeasurementFacet copy = new FlowVelocityMeasurementFacet(description);
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
60 copy.set(this);
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61 return copy;
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62 }
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
63 }
bdf321802d3d Add FlowVelocityMeasurementArtifact and -facet. Yet dummies.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org