annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManualPointsFacet.java @ 9801:1d7a72a50183 3.2.x tip

Assume Compose V2, consistently
author Tom Gottfried <tom@intevation.de>
date Thu, 23 Nov 2023 10:14:13 +0100
parents 0a5239a1e46e
children
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: 3225
diff changeset
9 package org.dive4elements.river.artifacts.model;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
10
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
11 import org.apache.logging.log4j.Logger;
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
12 import org.apache.logging.log4j.LogManager;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
13
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3225
diff changeset
14 import org.dive4elements.artifacts.Artifact;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3225
diff changeset
15 import org.dive4elements.artifacts.CallContext;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
16
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3225
diff changeset
17 import org.dive4elements.river.artifacts.ManualPointsArtifact;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
18
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3225
diff changeset
19 import org.dive4elements.artifactdatabase.state.DefaultFacet;
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 3225
diff changeset
20 import org.dive4elements.artifactdatabase.state.Facet;
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
21
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 /**
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
24 * Facet to access ManualPoints that where added by user.
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 ManualPointsFacet
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
27 extends DefaultFacet
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
28 {
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
29 /** Logger for this class. */
9726
0a5239a1e46e Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 8856
diff changeset
30 private static final Logger log = LogManager.getLogger(
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
31 ManualPointsFacet.class);
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
32
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
33
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 * Trivial Constructor.
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
36 */
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
37 public ManualPointsFacet() {
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
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
40
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 * Trivial Constructor for a ManualPointsFacet.
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 * @param index Database-Index to use.
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
45 * @param name Name (~type) of Facet.
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
46 * @param description Description of Facet.
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
47 */
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
48 public ManualPointsFacet(int index, String name, String description) {
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
49 super(index, name, description);
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
50 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
51
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
52
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
53 /**
3225
049ccd2c5935 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2206
diff changeset
54 * Get List of ManualPoints for river from Artifact.
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
55 *
8856
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
56 * @param artifact (ManualPoints-)Artifact to query
5e38e2924c07 Fix code style.
Tom Gottfried <tom@intevation.de>
parents: 8202
diff changeset
57 * for list of ManualPoints.
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
58 * @param context Ignored.
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 @Override
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
61 public Object getData(Artifact artifact, CallContext context) {
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
62 ManualPointsArtifact pointsArtifact = (ManualPointsArtifact) artifact;
2206
e2124ca11adb Add manual point handling for many different chart types.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 2173
diff changeset
63 return pointsArtifact.getPointsData(this.name);
2172
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
64 }
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 /** Do a deep copy. */
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
68 @Override
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
69 public Facet deepCopy() {
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
70 ManualPointsFacet copy = new ManualPointsFacet();
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
71 copy.set(this);
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
72 return copy;
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
73 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
74 }
3ecc76ef25a9 New, basic infrastructure for user-provided data ('manual points').
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff changeset
75 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org