Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java @ 7915:931dffefc3dd
flys/issue1628: Adjusted the PDF export.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 04 Jun 2014 15:34:22 +0200 |
parents | 9513d1af7d58 |
children | 42076d94977e |
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:
4826
diff
changeset
|
9 package org.dive4elements.river.artifacts.model.minfo; |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
10 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4826
diff
changeset
|
11 import org.dive4elements.artifacts.Artifact; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4826
diff
changeset
|
12 import org.dive4elements.artifacts.CallContext; |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
13 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4826
diff
changeset
|
14 import org.dive4elements.river.artifacts.access.BedHeightAccess; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4826
diff
changeset
|
15 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4826
diff
changeset
|
16 import org.dive4elements.river.artifacts.model.FacetTypes; |
7357
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
17 import org.dive4elements.river.model.BedHeightSingle; |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
18 import org.dive4elements.river.model.BedHeightSingleValue; |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
19 |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
20 public class BedHeightFacet |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
21 extends BlackboardDataFacet |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
22 implements FacetTypes { |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
23 |
4534
1619f80eb62e
Add type member variable to BedHeightFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3633
diff
changeset
|
24 private String type; |
3633
ebfce31c7eec
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3614
diff
changeset
|
25 |
4534
1619f80eb62e
Add type member variable to BedHeightFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3633
diff
changeset
|
26 public BedHeightFacet(String name, String description, String type) { |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
27 this.name = name; |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
28 this.description = description; |
4534
1619f80eb62e
Add type member variable to BedHeightFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3633
diff
changeset
|
29 this.type = type; |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
30 this.index = 0; |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
31 } |
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 /** |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
34 * Returns the data this facet requires. |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
35 * |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
36 * @param artifact the owner artifact. |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
37 * @param context the CallContext (ignored). |
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 * @return the data. |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
40 */ |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
41 @Override |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
42 public Object getData(Artifact artifact, CallContext context) { |
6101
a0078e5e3b39
Removed unused context from RangeAccess and subclasses leading to some dead code removal.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
43 BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact); |
4534
1619f80eb62e
Add type member variable to BedHeightFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3633
diff
changeset
|
44 if (type.equals("singlevalues")) { |
7357
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
45 /* Former doc (from BedHeightAccess): |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
46 * Return a {@link List} of {@link BedHeightSingleValue}s |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
47 * at the range of the artifact |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7373
diff
changeset
|
48 * @return List of {@link BedHeightSingleValue}s */ |
7357
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
49 BedHeightSingle single = BedHeightSingle.getBedHeightSingleById( |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
50 access.getHeightId()); |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
51 return BedHeightSingleValue.getBedHeightSingleValues(single, |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
52 access.getFrom(), |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
53 access.getTo()); |
4534
1619f80eb62e
Add type member variable to BedHeightFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3633
diff
changeset
|
54 } |
7357
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
55 else { |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
56 /* Former doc (from BedHeightAccess): |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
57 * Return the {@link BedHeight} at the height_id and time of the artifact |
7391
9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
7373
diff
changeset
|
58 * @return {@link BedHeight} */ |
7357
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
59 return BedHeightFactory.getHeight( |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
60 access.getType(), |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
61 access.getHeightId(), |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
62 access.getTime()); |
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
63 } |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
64 } |
7357
9d3e44ab25f2
Refactoring: Move functionality of BedHeightAccess into BedHeightFacet for now.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
6101
diff
changeset
|
65 |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
66 /** |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
67 * Create a deep copy of this Facet. |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
68 * @return a deep copy. |
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 @Override |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
71 public BedHeightFacet deepCopy() { |
4534
1619f80eb62e
Add type member variable to BedHeightFacet
Björn Ricks <bjoern.ricks@intevation.de>
parents:
3633
diff
changeset
|
72 BedHeightFacet copy = new BedHeightFacet(name, description, type); |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
73 copy.set(this); |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
74 return copy; |
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 } |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff
changeset
|
77 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |