Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWKmsArtifact.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 | 8d5ca5175038 |
children | 04367906f158 |
comparison
equal
deleted
inserted
replaced
8201:4b8c5a08de04 | 8202:e4606eae8ea5 |
---|---|
56 */ | 56 */ |
57 public class StaticWKmsArtifact | 57 public class StaticWKmsArtifact |
58 extends StaticD4EArtifact | 58 extends StaticD4EArtifact |
59 implements FacetTypes, WaterLineArtifact | 59 implements FacetTypes, WaterLineArtifact |
60 { | 60 { |
61 /** The logger for this class. */ | 61 /** The log for this class. */ |
62 private static Logger logger = | 62 private static Logger log = |
63 Logger.getLogger(StaticWKmsArtifact.class); | 63 Logger.getLogger(StaticWKmsArtifact.class); |
64 | 64 |
65 private static final String NAME = "staticwkms"; | 65 private static final String NAME = "staticwkms"; |
66 | 66 |
67 static { | 67 static { |
84 | 84 |
85 /** | 85 /** |
86 * Trivial Constructor. | 86 * Trivial Constructor. |
87 */ | 87 */ |
88 public StaticWKmsArtifact() { | 88 public StaticWKmsArtifact() { |
89 logger.debug("StaticWKmsArtifact.StaticWKmsArtifact"); | 89 log.debug("StaticWKmsArtifact.StaticWKmsArtifact"); |
90 } | 90 } |
91 | 91 |
92 @Override | 92 @Override |
93 public String getName() { | 93 public String getName() { |
94 return NAME; | 94 return NAME; |
104 Object context, | 104 Object context, |
105 CallMeta callMeta, | 105 CallMeta callMeta, |
106 Document data, | 106 Document data, |
107 List<Class> loadFacets) | 107 List<Class> loadFacets) |
108 { | 108 { |
109 logger.debug("StaticWKmsArtifact.setup"); | 109 log.debug("StaticWKmsArtifact.setup"); |
110 | 110 |
111 state = new StaticState(STATIC_STATE_NAME); | 111 state = new StaticState(STATIC_STATE_NAME); |
112 | 112 |
113 if (logger.isDebugEnabled()) { | 113 if (log.isDebugEnabled()) { |
114 logger.debug(XMLUtils.toString(data)); | 114 log.debug(XMLUtils.toString(data)); |
115 } | 115 } |
116 | 116 |
117 List<Facet> fs = new ArrayList<Facet>(); | 117 List<Facet> fs = new ArrayList<Facet>(); |
118 String code = getDatacageIDValue(data); | 118 String code = getDatacageIDValue(data); |
119 | 119 |
211 protected void initialize( | 211 protected void initialize( |
212 Artifact artifact, | 212 Artifact artifact, |
213 Object context, | 213 Object context, |
214 CallMeta meta) | 214 CallMeta meta) |
215 { | 215 { |
216 logger.debug("StaticWKmsArtifact.initialize"); | 216 log.debug("StaticWKmsArtifact.initialize"); |
217 D4EArtifact winfo = (D4EArtifact) artifact; | 217 D4EArtifact winfo = (D4EArtifact) artifact; |
218 // TODO: The river is of no interest, so far. | 218 // TODO: The river is of no interest, so far. |
219 addData("river", winfo.getData("river")); | 219 addData("river", winfo.getData("river")); |
220 } | 220 } |
221 | 221 |
271 * Get WKms from factory. | 271 * Get WKms from factory. |
272 * @param idx param is not needed (TODO?) | 272 * @param idx param is not needed (TODO?) |
273 * @return WKms according to parameterization (can be null); | 273 * @return WKms according to parameterization (can be null); |
274 */ | 274 */ |
275 public WKms getWKms(int idx) { | 275 public WKms getWKms(int idx) { |
276 logger.debug("StaticWKmsArtifact.getWKms"); | 276 log.debug("StaticWKmsArtifact.getWKms"); |
277 | 277 |
278 return WKmsFactory.getWKms( | 278 return WKmsFactory.getWKms( |
279 Integer.parseInt(getDataAsString("col_pos")), | 279 Integer.parseInt(getDataAsString("col_pos")), |
280 Integer.parseInt(getDataAsString("wst_id"))); | 280 Integer.parseInt(getDataAsString("wst_id"))); |
281 } | 281 } |
413 */ | 413 */ |
414 @Override | 414 @Override |
415 public Lines.LineData getWaterLines(int idx, FastCrossSectionLine csl, | 415 public Lines.LineData getWaterLines(int idx, FastCrossSectionLine csl, |
416 double next, double prev, CallContext context | 416 double next, double prev, CallContext context |
417 ) { | 417 ) { |
418 logger.debug("getWaterLines(" + idx + ")/" + identifier()); | 418 log.debug("getWaterLines(" + idx + ")/" + identifier()); |
419 | 419 |
420 List<Point2D> points = csl.getPoints(); | 420 List<Point2D> points = csl.getPoints(); |
421 | 421 |
422 WKms wkms = getWKms(0); | 422 WKms wkms = getWKms(0); |
423 | 423 |
434 else { | 434 else { |
435 wAtKm = getWAtKm(wkms, km); | 435 wAtKm = getWAtKm(wkms, km); |
436 } | 436 } |
437 | 437 |
438 if (wAtKm == -1 || Double.isNaN(wAtKm)) { | 438 if (wAtKm == -1 || Double.isNaN(wAtKm)) { |
439 logger.warn("Waterlevel at km " + km + " unknown."); | 439 log.warn("Waterlevel at km " + km + " unknown."); |
440 return new Lines.LineData(new double[][] {{}}, 0d, 0d); | 440 return new Lines.LineData(new double[][] {{}}, 0d, 0d); |
441 } | 441 } |
442 | 442 |
443 return Lines.createWaterLines(points, wAtKm); | 443 return Lines.createWaterLines(points, wAtKm); |
444 } | 444 } |