Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/states/QSectorSingleState.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:
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:
4433
diff
changeset
|
9 package org.dive4elements.river.artifacts.states; |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import java.util.List; |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 |
9726 | 13 import org.apache.logging.log4j.Logger; |
14 import org.apache.logging.log4j.LogManager; | |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
16 import org.dive4elements.artifacts.CallMeta; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
17 import org.dive4elements.artifacts.CallContext; |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
19 import org.dive4elements.artifactdatabase.state.Facet; |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
21 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
22 import org.dive4elements.river.artifacts.QSectorArtifact; |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
24 import org.dive4elements.river.artifacts.model.FacetTypes; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
25 import org.dive4elements.river.artifacts.model.QSectorFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
26 |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4433
diff
changeset
|
27 import org.dive4elements.river.artifacts.resources.Resources; |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 /** |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 * The only state for an QSectorArtifact. |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 */ |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 public class QSectorSingleState |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 extends DefaultState |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 implements FacetTypes |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 { |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
36 /** Developer-centric description of facet. */ |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
37 public static final String I18N_DESCRIPTION |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
38 = "facet.qsector"; |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
39 |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
40 /** The log that is used in this state. */ |
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
41 private static final Logger log = |
9726 | 42 LogManager.getLogger(QSectorSingleState.class); |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
43 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
44 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
45 /** |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
46 * Add QSectorFacets to list of Facets. |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
47 * |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
48 * @param artifact Ignored. |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
49 * @param hash Ignored. |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
50 * @param meta CallMeta to be used for internationalization. |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
51 * @param facets List to add QSectorFacet to. |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
52 * |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
53 * @return null. |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
54 */ |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
55 public Object compute( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
56 D4EArtifact artifact, |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
57 String hash, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
58 CallMeta meta, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
59 List<Facet> facets |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
60 ) { |
8202
e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
61 log.debug("QSectorSingleState.compute()"); |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
62 QSectorArtifact points = (QSectorArtifact) artifact; |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
63 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
64 QSectorFacet qfacet = new QSectorFacet( |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
65 0, |
3576
6442f317a0c7
i18n and renderering of qsectors in w/q diag.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
3575
diff
changeset
|
66 QSECTOR, |
4433
5b8919ef601d
Backed out changeset e8a4d2fd25cc
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4432
diff
changeset
|
67 Resources.getMsg(meta, "qsectors", "Q Sectors")); |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
68 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
69 facets.add(qfacet); |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
70 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
71 return null; |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
72 } |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
73 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
74 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
75 /** Call compute. */ |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
76 @Override |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
77 public Object computeInit( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
78 D4EArtifact artifact, |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
79 String hash, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
80 Object context, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
81 CallMeta meta, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
82 List<Facet> facets |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
83 ) { |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
84 return compute(artifact, hash, meta, facets); |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
85 } |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
86 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
87 |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
88 /** Call compute. */ |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
89 @Override |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
90 public Object computeFeed( |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
91 D4EArtifact artifact, |
3575
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
92 String hash, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
93 CallContext context, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
94 List<Facet> facets, |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
95 Object old |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
96 ) { |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
97 return compute(artifact, hash, context.getMeta(), facets); |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
98 } |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
99 } |
e9c3285f2ee2
Added State for QSector artifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
100 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |