comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/QSectorFacet.java @ 8369:a5bd0a5b8efd

Use the CURRENT_KM constant from injectors.
author Raimund Renkert <rrenkert@intevation.de>
date Thu, 02 Oct 2014 13:57:50 +0200
parents e4606eae8ea5
children 0a5239a1e46e
comparison
equal deleted inserted replaced
8363:3508d625092f 8369:a5bd0a5b8efd
15 15
16 import org.dive4elements.river.artifacts.QSectorArtifact; 16 import org.dive4elements.river.artifacts.QSectorArtifact;
17 17
18 import org.dive4elements.artifactdatabase.state.DefaultFacet; 18 import org.dive4elements.artifactdatabase.state.DefaultFacet;
19 import org.dive4elements.artifactdatabase.state.Facet; 19 import org.dive4elements.artifactdatabase.state.Facet;
20
21 import static org.dive4elements.river.exports.injector.InjectorConstants.CURRENT_KM;
20 22
21 23
22 /** 24 /**
23 * Facet to access QSector that where added by user. 25 * Facet to access QSector that where added by user.
24 */ 26 */
56 */ 58 */
57 @Override 59 @Override
58 public Object getData(Artifact artifact, CallContext context) { 60 public Object getData(Artifact artifact, CallContext context) {
59 QSectorArtifact qsectorArtifact = (QSectorArtifact) artifact; 61 QSectorArtifact qsectorArtifact = (QSectorArtifact) artifact;
60 if (qsectorArtifact == null || context == null || 62 if (qsectorArtifact == null || context == null ||
61 context.getContextValue("currentKm") == null) { 63 context.getContextValue(CURRENT_KM) == null) {
62 log.error("No artifact, context or currentKm in QSectorFacet"); 64 log.error("No artifact, context or currentKm in QSectorFacet");
63 return null; 65 return null;
64 } 66 }
65 double currentKm = 67 double currentKm =
66 ((Double)context.getContextValue("currentKm")).doubleValue(); 68 ((Double)context.getContextValue(CURRENT_KM)).doubleValue();
67 return qsectorArtifact.getQSectors(currentKm, context); 69 return qsectorArtifact.getQSectors(currentKm, context);
68 } 70 }
69 71
70 72
71 /** Do a deep copy. */ 73 /** Do a deep copy. */

http://dive4elements.wald.intevation.org