changeset 2028:f834a6961bb7

Refactored, make usage of blackboarddatafacet. flys-artifacts/trunk@3490 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 20 Dec 2011 11:28:13 +0000
parents 9d92c894941b
children 131842fc6581
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java
diffstat 2 files changed, 6 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Dec 20 11:26:24 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Dec 20 11:28:13 2011 +0000
@@ -1,3 +1,8 @@
+2011-12-20	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java:
+	  Refactoring, subclass BlackboardDataFacet, remove duplicate code.
+
 2011-12-20	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Cosmetics.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java	Tue Dec 20 11:26:24 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java	Tue Dec 20 11:28:13 2011 +0000
@@ -2,7 +2,6 @@
 
 import org.apache.log4j.Logger;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import de.intevation.flys.model.CrossSectionLine;
@@ -10,7 +9,6 @@
 import de.intevation.artifacts.Artifact;
 import de.intevation.artifacts.CallContext;
 
-import de.intevation.artifactdatabase.state.DefaultFacet;
 import de.intevation.artifactdatabase.state.Facet;
 import de.intevation.artifacts.DataProvider;
 
@@ -21,7 +19,7 @@
  * Facet for Waterlines in Cross Sections.
  */
 public class CrossSectionWaterLineFacet
-extends      DefaultFacet
+extends      BlackboardDataFacet
 implements   FacetTypes {
 
     private static Logger logger = Logger.getLogger(CrossSectionWaterLineFacet.class);
@@ -55,36 +53,6 @@
     }
 
 
-    public List getDataProviderKeys(Artifact art) {
-        List list = new ArrayList();
-        list.add(art.identifier() + getIndex());
-        return list;
-    }
-
-
-    /**
-     * Can provide the curve/line drawn.
-     * @param key      will respond on uuid+index
-     * @param param    ignored
-     * @param context  ignored
-     * @return data to draw "intersection" of master cross section and
-     *         the waterlevel at that position.
-     */
-    public Object provideBlackboardData(Artifact artifact,
-        Object key,
-        Object param,
-        CallContext context
-    ) {
-        if (key.equals(artifact.identifier() + getIndex())) {
-            return getData(artifact, context);
-        }
-        else {
-            logger.warn("Cannot provide data for key: " + key);
-            return null;
-        }
-    }
-
-
     /** Do a deep copy. */
     @Override 
     public Facet deepCopy() {

http://dive4elements.wald.intevation.org