Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCrossSectionFacet.java @ 9506:8b7bf26b8782
Predefined artifact for standard vegetation zones.
Some minor adaptions.
author | gernotbelger |
---|---|
date | Fri, 28 Sep 2018 13:44:12 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
9505:3f230fe8eb19 | 9506:8b7bf26b8782 |
---|---|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.artifacts.uinfo.vegetationzones; | |
11 | |
12 import org.dive4elements.artifacts.Artifact; | |
13 import org.dive4elements.artifacts.CallContext; | |
14 import org.dive4elements.river.artifacts.D4EArtifact; | |
15 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; | |
16 import org.dive4elements.river.artifacts.model.FacetTypes; | |
17 import org.dive4elements.river.exports.CrossSectionGenerator; | |
18 | |
19 /** | |
20 * @author Gernot Belger | |
21 * | |
22 */ | |
23 public final class VegetationZonesCrossSectionFacet extends BlackboardDataFacet implements FacetTypes { | |
24 | |
25 private static final long serialVersionUID = 1L; | |
26 | |
27 public VegetationZonesCrossSectionFacet(final String name, final String description) { | |
28 super(0, name, description); | |
29 | |
30 this.metaData.put("X", CrossSectionGenerator.I18N_XAXIS_LABEL); | |
31 this.metaData.put("Y", CrossSectionGenerator.I18N_YAXIS_LABEL); | |
32 } | |
33 | |
34 /** | |
35 * Returns the data this facet requires. | |
36 * | |
37 * @param artifact | |
38 * the owner artifact. | |
39 * @param context | |
40 * the CallContext (ignored). | |
41 * | |
42 * @return | |
43 * the data as PredefinedChannelQueryCalculationResult | |
44 */ | |
45 @Override | |
46 public Object getData(final Artifact artifact, final CallContext context) { | |
47 | |
48 final VegetationzonesAccess vAccess = new VegetationzonesAccess((D4EArtifact) artifact); | |
49 return VegetationZoneServerClientXChange.parse(vAccess.getVegZones()); | |
50 } | |
51 | |
52 /** | |
53 * Create a deep copy of this Facet. | |
54 * | |
55 * @return a deep copy. | |
56 */ | |
57 @Override | |
58 public VegetationZonesCrossSectionFacet deepCopy() { | |
59 final VegetationZonesCrossSectionFacet copy = new VegetationZonesCrossSectionFacet(this.name, this.description); | |
60 copy.set(this); | |
61 return copy; | |
62 } | |
63 } |