Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/LocationDistanceSelect.java @ 687:06689035024c facets-slt
Added a compute() method to WINFOArtifact which acts as a dispatcher for different computations. It triggers a calculation based on ComputeCallbacks that are generated by the current states.
flys-artifacts/branches/facets-slt@2127 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 16 Jun 2011 07:50:56 +0000 |
parents | 627be3ca1ab6 |
children | f8ac04b2dbd0 |
comparison
equal
deleted
inserted
replaced
686:3dc61e00385e | 687:06689035024c |
---|---|
1 package de.intevation.flys.artifacts.states; | 1 package de.intevation.flys.artifacts.states; |
2 | |
3 import java.util.List; | |
2 | 4 |
3 import org.apache.log4j.Logger; | 5 import org.apache.log4j.Logger; |
4 | 6 |
5 import org.w3c.dom.Element; | 7 import org.w3c.dom.Element; |
6 | 8 |
11 | 13 |
12 import de.intevation.artifacts.common.utils.XMLUtils; | 14 import de.intevation.artifacts.common.utils.XMLUtils; |
13 | 15 |
14 import de.intevation.artifactdatabase.ProtocolUtils; | 16 import de.intevation.artifactdatabase.ProtocolUtils; |
15 import de.intevation.artifactdatabase.data.StateData; | 17 import de.intevation.artifactdatabase.data.StateData; |
18 import de.intevation.artifactdatabase.state.Facet; | |
16 | 19 |
17 import de.intevation.flys.model.River; | 20 import de.intevation.flys.model.River; |
18 | 21 |
19 import de.intevation.flys.artifacts.FLYSArtifact; | 22 import de.intevation.flys.artifacts.FLYSArtifact; |
23 import de.intevation.flys.artifacts.WINFOArtifact; | |
24 import de.intevation.flys.artifacts.model.ComputeCallback; | |
20 import de.intevation.flys.artifacts.model.RiverFactory; | 25 import de.intevation.flys.artifacts.model.RiverFactory; |
21 import de.intevation.flys.artifacts.resources.Resources; | 26 import de.intevation.flys.artifacts.resources.Resources; |
22 | 27 |
23 /** | 28 /** |
24 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 29 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
288 } | 293 } |
289 } | 294 } |
290 | 295 |
291 return values.toNativeArray(); | 296 return values.toNativeArray(); |
292 } | 297 } |
298 | |
299 | |
300 @Override | |
301 public ComputeCallback createComputeCallback( | |
302 String hash, FLYSArtifact flys) | |
303 { | |
304 final WINFOArtifact winfo = (WINFOArtifact) flys; | |
305 | |
306 return new ComputeCallback() { | |
307 public Object compute(List<Facet> facets) { | |
308 return winfo.getDischargeCurveData(); | |
309 } | |
310 }; | |
311 } | |
293 } | 312 } |
294 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 313 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |