[Dive4elements-commits] [PATCH 2 of 8] Add type member variable to BedHeightFacet

Wald Commits scm-commit at wald.intevation.org
Thu Nov 15 16:31:31 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1352992682 -3600
# Node ID 1619f80eb62ebce85fc31e9aad4537c2bf510b4a
# Parent  0a0ab6909cd8c4c480a29721eddb409171a0c50f
Add type member variable to BedHeightFacet

The type can either be single, epoch or singlevalues.

diff -r 0a0ab6909cd8 -r 1619f80eb62e flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFacet.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFacet.java	Thu Nov 15 16:14:42 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFacet.java	Thu Nov 15 16:18:02 2012 +0100
@@ -10,13 +10,12 @@
 extends      BlackboardDataFacet
 implements   FacetTypes {
 
-    public BedHeightFacet(String description) {
-        this(STATIC_BEDHEIGHT, description);
-    }
+    private String type;
 
-    public BedHeightFacet(String name, String description) {
+    public BedHeightFacet(String name, String description, String type) {
         this.name = name;
         this.description = description;
+        this.type = type;
         this.index = 0;
     }
 
@@ -32,6 +31,9 @@
     public Object getData(Artifact artifact, CallContext context) {
         BedHeightsArtifact staticData =
             (BedHeightsArtifact) artifact;
+        if (type.equals("singlevalues")) {
+            return staticData.getSingleValues();
+        }
         return staticData.getHeight();
     }
     /**
@@ -40,7 +42,7 @@
      */
     @Override
     public BedHeightFacet deepCopy() {
-        BedHeightFacet copy = new BedHeightFacet(description);
+        BedHeightFacet copy = new BedHeightFacet(name, description, type);
         copy.set(this);
         return copy;
     }


More information about the Dive4elements-commits mailing list