comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQFacet.java @ 3318:dbe2f85bf160

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

http://dive4elements.wald.intevation.org