Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java @ 8202:e4606eae8ea5
sed src/**/*.java 's/logger/log/g'
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 12:58:17 +0200 |
parents | eb48b244921d |
children | c657ddcf1fa6 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
33 /** Facet to access various sediment loads. */ | 33 /** Facet to access various sediment loads. */ |
34 public class SedimentLoadFacet | 34 public class SedimentLoadFacet |
35 extends DataFacet | 35 extends DataFacet |
36 implements StaticFacet | 36 implements StaticFacet |
37 { | 37 { |
38 private static Logger logger = Logger.getLogger(SedimentLoadFacet.class); | 38 private static Logger log = Logger.getLogger(SedimentLoadFacet.class); |
39 | 39 |
40 private static final String NAME = "sedimentload"; | 40 private static final String NAME = "sedimentload"; |
41 | 41 |
42 public SedimentLoadFacet() { | 42 public SedimentLoadFacet() { |
43 } | 43 } |
49 this.metaData.put("Y", ""); | 49 this.metaData.put("Y", ""); |
50 } | 50 } |
51 | 51 |
52 @Override | 52 @Override |
53 public Object getData(Artifact artifact, CallContext context) { | 53 public Object getData(Artifact artifact, CallContext context) { |
54 logger.debug("get Data"); | 54 log.debug("get Data"); |
55 D4EArtifact arti = (D4EArtifact) artifact; | 55 D4EArtifact arti = (D4EArtifact) artifact; |
56 | 56 |
57 RiverAccess access = new RiverAccess(arti); | 57 RiverAccess access = new RiverAccess(arti); |
58 String idStr = arti.getDataAsString("load_id"); | 58 String idStr = arti.getDataAsString("load_id"); |
59 int id = Integer.valueOf(idStr); | 59 int id = Integer.valueOf(idStr); |
78 return new double[][] {xPos.toNativeArray(), yPos.toNativeArray()}; | 78 return new double[][] {xPos.toNativeArray(), yPos.toNativeArray()}; |
79 } | 79 } |
80 | 80 |
81 @Override | 81 @Override |
82 public void setup(Artifact artifact, Document data, CallMeta callMeta) { | 82 public void setup(Artifact artifact, Document data, CallMeta callMeta) { |
83 logger.debug("setup"); | 83 log.debug("setup"); |
84 String code = D4EArtifact.getDatacageIDValue(data); | 84 String code = D4EArtifact.getDatacageIDValue(data); |
85 String[] split = code.split(";"); | 85 String[] split = code.split(";"); |
86 String idStr = split[0]; | 86 String idStr = split[0]; |
87 | 87 |
88 String fraction = split.length >= 2 ? split[1] : ""; | 88 String fraction = split.length >= 2 ? split[1] : ""; |
89 String years = split.length >= 3 ? split[2] : ""; | 89 String years = split.length >= 3 ? split[2] : ""; |
90 | 90 |
91 // Name has the pattern sedimentload.<grainfraction_name> | 91 // Name has the pattern sedimentload.<grainfraction_name> |
92 name = NAME + "." + fraction; | 92 name = NAME + "." + fraction; |
93 logger.debug("Created facet: " + name); | 93 log.debug("Created facet: " + name); |
94 | 94 |
95 description = Resources.getMsg( | 95 description = Resources.getMsg( |
96 callMeta, | 96 callMeta, |
97 "facet.sedimentload." + fraction, | 97 "facet.sedimentload." + fraction, |
98 new Object[] { years, "t/a" }); | 98 new Object[] { years, "t/a" }); |