Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WQKmsFacet.java @ 3812:f788d2d901d6
merged flys-artifacts/pre2.6-2011-12-05
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:14:53 +0200 |
parents | 02cd002205a3 |
children | a202a9e048a5 |
comparison
equal
deleted
inserted
replaced
3808:5fab0fe3c445 | 3812:f788d2d901d6 |
---|---|
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.StaticWQKmsArtifact; | |
9 import de.intevation.flys.artifacts.model.FacetTypes; | |
10 | |
11 /** | |
12 * Facet to show W|Q|km Values. | |
13 */ | |
14 public class WQKmsFacet | |
15 extends DefaultFacet | |
16 implements FacetTypes { | |
17 | |
18 /** Trivial Constructor. */ | |
19 public WQKmsFacet(String description) { | |
20 this(STATIC_WQKMS, description); | |
21 } | |
22 | |
23 public WQKmsFacet(String name, String description) { | |
24 this.name = name; | |
25 this.description = description; | |
26 this.index = 0; | |
27 } | |
28 | |
29 | |
30 /** | |
31 * Returns the data this facet requires. | |
32 * | |
33 * @param artifact the owner artifact. | |
34 * @param context the CallContext (ignored). | |
35 * | |
36 * @return the data. | |
37 */ | |
38 @Override | |
39 public Object getData(Artifact artifact, CallContext context) { | |
40 StaticWQKmsArtifact staticData = | |
41 (StaticWQKmsArtifact) artifact; | |
42 return staticData.getWQKms(0); | |
43 } | |
44 | |
45 | |
46 /** | |
47 * Create a deep copy of this Facet. | |
48 * @return a deep copy. | |
49 */ | |
50 @Override | |
51 public WQKmsFacet deepCopy() { | |
52 WQKmsFacet copy = new WQKmsFacet(description); | |
53 copy.set(this); | |
54 return copy; | |
55 } | |
56 } | |
57 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |