Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQFacet.java @ 2424:092e519ff461
merged flys-artifacts/2.6.1
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:26 +0200 |
parents | 2e2ca95459d2 |
children | 0f7abd95c6e2 |
comparison
equal
deleted
inserted
replaced
2392:8112ec686a9a | 2424:092e519ff461 |
---|---|
1 package de.intevation.flys.artifacts.model; | |
2 | |
3 import de.intevation.artifacts.Artifact; | |
4 import de.intevation.artifacts.CallContext; | |
5 | |
6 import de.intevation.artifactdatabase.state.DefaultFacet; | |
7 | |
8 import de.intevation.flys.artifacts.WQKmsInterpolArtifact; | |
9 import de.intevation.flys.artifacts.model.FacetTypes; | |
10 | |
11 /** | |
12 * Facet to show W|Q Values. | |
13 */ | |
14 public class WQFacet | |
15 extends DefaultFacet | |
16 implements FacetTypes { | |
17 | |
18 /** Trivial Constructor. */ | |
19 public WQFacet(String description) { | |
20 this(STATIC_WQ, description); | |
21 } | |
22 | |
23 | |
24 /** | |
25 * A Facet with WQ data. | |
26 */ | |
27 public WQFacet(String name, String description) { | |
28 this.name = name; | |
29 this.description = description; | |
30 this.index = 0; | |
31 } | |
32 | |
33 | |
34 /** | |
35 * Returns the data this facet requires. | |
36 * | |
37 * @param artifact the owner artifact. | |
38 * @param context the CallContext (ignored). | |
39 * | |
40 * @return the data. | |
41 */ | |
42 @Override | |
43 public Object getData(Artifact artifact, CallContext context) { | |
44 WQKmsInterpolArtifact interpolData = | |
45 (WQKmsInterpolArtifact) artifact; | |
46 return interpolData.getWQAtKm(10); | |
47 } | |
48 | |
49 | |
50 /** | |
51 * Create a deep copy of this Facet. | |
52 * @return a deep copy. | |
53 */ | |
54 @Override | |
55 public WQKmsFacet deepCopy() { | |
56 WQKmsFacet copy = new WQKmsFacet(description); | |
57 copy.set(this); | |
58 return copy; | |
59 } | |
60 } | |
61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |