changeset 2405:f008c3335a77

Towards fixe of flys/issue495. flys-artifacts/trunk@4033 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 10 Feb 2012 12:41:12 +0000
parents 750cdcccb39c
children 84cdde4bc482
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/BlackboardDataFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ReferenceCurveFacet.java
diffstat 4 files changed, 35 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Feb 10 12:09:36 2012 +0000
+++ b/flys-artifacts/ChangeLog	Fri Feb 10 12:41:12 2012 +0000
@@ -1,3 +1,12 @@
+2012-02-10	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java,
+	  src/main/java/de/intevation/flys/artifacts/model/BlackboardDataFacet.java:
+	  Adjust function to deliver data provider ('blackboard') keys.
+
+	* src/main/java/de/intevation/flys/artifacts/model/ReferenceCurveFacet.java:
+	  Change the way we exploit the blackboard-mechanism. TODOs added.
+
 2012-02-10  Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/model/WstValueTable.java:
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/BlackboardDataFacet.java	Fri Feb 10 12:09:36 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/BlackboardDataFacet.java	Fri Feb 10 12:41:12 2012 +0000
@@ -36,7 +36,8 @@
 
 
     /** Hey, We can ArtifactUUID+:+FacetName+:+FacetIndex (i.e. getData)! */
-    public List getDataProviderKeys(Artifact art) {
+    @Override
+    public List getStaticDataProviderKeys(Artifact art) {
         List list = new ArrayList();
         list.add(areaDataKey(art));
         return list;
@@ -50,6 +51,7 @@
      * @param context  ignored
      * @return whatever getData delivers.
      */
+    @Override
     public Object provideBlackboardData(Artifact artifact,
         Object key,
         Object param,
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java	Fri Feb 10 12:09:36 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java	Fri Feb 10 12:41:12 2012 +0000
@@ -38,14 +38,14 @@
 
 
     /** Tell world we know about crosssection masters data and its index. */
-    public List getDataProviderKeys(Artifact art) {
+    public List getStaticDataProviderKeys(Artifact art) {
         CrossSectionArtifact artifact = (CrossSectionArtifact) art;
         List keys = new ArrayList();
         if (artifact.isMaster()) {
             keys.add(BLACKBOARD_CS_MASTER_DATA);
         }
         keys.add(artifact.identifier() + getIndex());
-        keys.addAll(super.getDataProviderKeys(art));
+        keys.addAll(super.getStaticDataProviderKeys(art));
         return keys;
     }
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ReferenceCurveFacet.java	Fri Feb 10 12:09:36 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ReferenceCurveFacet.java	Fri Feb 10 12:41:12 2012 +0000
@@ -1,7 +1,8 @@
 package de.intevation.flys.artifacts.model;
 
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
-import java.util.Arrays;
 
 import de.intevation.artifactdatabase.state.Facet;
 
@@ -65,10 +66,10 @@
     @Override
     public void set(Facet other) {
         super.set(other);
-        ReferenceCurveFacet o= (ReferenceCurveFacet)other;
-        type    = o.type;
-        hash    = o.hash;
-        stateId = o.stateId;
+        ReferenceCurveFacet o = (ReferenceCurveFacet)other;
+        type                  = o.type;
+        hash                  = o.hash;
+        stateId               = o.stateId;
     }
 
     /** Copy deeply. */
@@ -80,7 +81,20 @@
     }
 
     @Override
-    public List getDataProviderKeys(Artifact art) {
+    public List getDataProviderKeys(Artifact art, CallContext context) {
+        // Answer to key only if x or y in meter...
+        List keys = new ArrayList();
+        // compute / get data
+        Object obj = context.getContextValue("reference.curve.axis.scale");
+
+        if (!(obj instanceof WWAxisTypes)) {
+            obj = new WWAxisTypes(getWWQQ(art, context));
+            context.putContextValue("reference.curve.axis.scale", obj);
+        }
+        else {
+            ((WWAxisTypes)obj).classify(getWWQQ(art, context));
+        }
+        // TODO we do not need to provide data
         return BLACK_BOARD_KEY_LIST;
     }
 
@@ -91,6 +105,7 @@
         Object      param,
         CallContext context
     ) {
+        // TODO we do not really need to provide data
         if (!key.equals(BLACK_BOARD_KEY)) {
             return null;
         }

http://dive4elements.wald.intevation.org