changeset 4534:1619f80eb62e

Add type member variable to BedHeightFacet The type can either be single, epoch or singlevalues.
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 15 Nov 2012 16:18:02 +0100
parents 0a0ab6909cd8
children b838d16c629e
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFacet.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }

http://dive4elements.wald.intevation.org