Mercurial > dive4elements > river
changeset 2002:98f3ef8da857
Register under a key on blackboard to meet assumptions by areaartifact.
flys-artifacts/trunk@3444 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 16 Dec 2011 14:08:22 +0000 |
parents | 28a5c163f9cd |
children | ec5d6149b176 |
files | flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java |
diffstat | 3 files changed, 42 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Fri Dec 16 14:02:59 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Dec 16 14:08:22 2011 +0000 @@ -1,3 +1,10 @@ +2011-12-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java, + src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java: + Register blackboard key uuid+index and respond with data to it, as + assumed by the areaartifact and facet. + 2011-12-16 Felix Wolfsteller <felix.wolfsteller@intevation.de> Added partial area-infrastructure.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java Fri Dec 16 14:02:59 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionFacet.java Fri Dec 16 14:08:22 2011 +0000 @@ -45,6 +45,7 @@ if (artifact.isMaster()) { keys.add(BLACKBOARD_CS_MASTER_DATA); } + keys.add(artifact.identifier() + getIndex()); return keys; } @@ -67,6 +68,9 @@ if (key.equals(BLACKBOARD_CS_MASTER_DATA)) { return crossSection.searchCrossSectionLine(); } + else if (key.equals(artifact.identifier() + getIndex())) { + return getData(artifact, context); + } else { logger.warn("Cannot provide data for key: " + key); return null;
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java Fri Dec 16 14:02:59 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/CrossSectionWaterLineFacet.java Fri Dec 16 14:08:22 2011 +0000 @@ -2,6 +2,7 @@ import org.apache.log4j.Logger; +import java.util.ArrayList; import java.util.List; import de.intevation.flys.model.CrossSectionLine; @@ -54,6 +55,36 @@ } + public List getDataProviderKeys(Artifact art) { + List list = new ArrayList(); + list.add(art.identifier() + getIndex()); + return list; + } + + + /** + * Can provide the master cross section lines or its index. + * @param artifact crosssection-artifact + * @param key will respond on BLACKBOARD_CS_MASTER_DATA + * @param param ignored + * @param context ignored + * @return data from artifact (cross section master track). + */ + 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() {