Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/BlackboardDataFacet.java @ 2104:bb0dede9294f
Implementation towards areas at other than first axis (flys/issue441).
flys-artifacts/trunk@3661 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 12 Jan 2012 12:29:56 +0000 |
parents | 2bb160b2768e |
children | 81312f84689a |
comparison
equal
deleted
inserted
replaced
2103:b9f7ec9bda18 | 2104:bb0dede9294f |
---|---|
21 public BlackboardDataFacet(int idx, String name, String description) { | 21 public BlackboardDataFacet(int idx, String name, String description) { |
22 super(idx, name, description); | 22 super(idx, name, description); |
23 } | 23 } |
24 | 24 |
25 | 25 |
26 /** Hey, We can ArtifactUUID+FacetIndex (i.e. getData)! */ | 26 /** Define key to which to respond when asked for 'blackboard' |
27 * (DataProvider)- data. */ | |
28 public String areaDataKey(Artifact art) { | |
29 return art.identifier() + ":" + getName() + ":" + getIndex(); | |
30 } | |
31 | |
32 | |
33 /** Hey, We can ArtifactUUID+:+FacetName+:+FacetIndex (i.e. getData)! */ | |
27 public List getDataProviderKeys(Artifact art) { | 34 public List getDataProviderKeys(Artifact art) { |
28 List list = new ArrayList(); | 35 List list = new ArrayList(); |
29 list.add(art.identifier() + getIndex()); | 36 list.add(areaDataKey(art)); |
30 return list; | 37 return list; |
31 } | 38 } |
32 | 39 |
33 | 40 |
34 /** | 41 /** |
41 public Object provideBlackboardData(Artifact artifact, | 48 public Object provideBlackboardData(Artifact artifact, |
42 Object key, | 49 Object key, |
43 Object param, | 50 Object param, |
44 CallContext context | 51 CallContext context |
45 ) { | 52 ) { |
46 if (key.equals(artifact.identifier() + getIndex())) { | 53 if (key.equals(areaDataKey(artifact))) { |
47 return getData(artifact, context); | 54 return getData(artifact, context); |
48 } | 55 } |
49 else { | 56 else { |
50 return null; | 57 return null; |
51 } | 58 } |
52 } | 59 } |
53 | |
54 } | 60 } |
55 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |