comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/NaviChartOutputTab.java @ 4322:f36550788add

NaviChartOutputTab: Get relevant data also from not-fixationanalysis-artifacts.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 30 Oct 2012 12:04:49 +0100
parents e7f7be368cf3
children acfd48384835
comparison
equal deleted inserted replaced
4321:e7f7be368cf3 4322:f36550788add
102 fromKm = fixFilter.getFromKm(); 102 fromKm = fixFilter.getFromKm();
103 toKm = fixFilter.getToKm(); 103 toKm = fixFilter.getToKm();
104 } 104 }
105 else { 105 else {
106 // Probably WINFOArtifact kind of artifact. 106 // Probably WINFOArtifact kind of artifact.
107 // TODO Proper implementation 107 String ld_step =
108 // collectionView set real steps. 108 art.getArtifactDescription().getDataValueAsString("ld_step");
109 collectionView.setSteps(100d); 109 try {
110 fromKm = 0d; 110 collectionView.setSteps(Double.valueOf(ld_step));
111 toKm = 93d; 111 }
112 catch (Exception e) {
113 GWT.log("No ld_steps data or not parsable.");
114 return root;
115 }
116
117 double[] kmRange = art.getArtifactDescription().getKMRange();
118 if (kmRange == null || kmRange.length == 2) {
119 fromKm = kmRange[0];
120 toKm = kmRange[1];
121 }
122 else {
123 GWT.log("No KM range in description found.");
124 return root;
125 }
112 } 126 }
113 127
114 collectionView.setMinKm(fromKm); 128 collectionView.setMinKm(fromKm);
115 collectionView.setMaxKm(toKm); 129 collectionView.setMaxKm(toKm);
116 130
282 imgUrl += "&miny=" + zoom[2]; 296 imgUrl += "&miny=" + zoom[2];
283 imgUrl += "&maxy=" + zoom[3]; 297 imgUrl += "&maxy=" + zoom[3];
284 } 298 }
285 } 299 }
286 300
287 if(collectionView.getArtifact() instanceof FixAnalysisArtifact) { 301 if (collectionView.getArtifact() instanceof FixAnalysisArtifact) {
288 if (collectionView.getCurrentKm() == -1) { 302 if (collectionView.getCurrentKm() == -1) {
289 FixAnalysisArtifact fix = 303 FixAnalysisArtifact fix =
290 (FixAnalysisArtifact) collectionView.getArtifact(); 304 (FixAnalysisArtifact) collectionView.getArtifact();
291 collectionView.setCurrentKm(fix.getFilter().getFromKm()); 305 collectionView.setCurrentKm(fix.getFilter().getFromKm());
292 } 306 }
307 }
308 else if (collectionView.getCurrentKm() == -1) {
309 collectionView.setCurrentKm(collectionView.getArtifact().getArtifactDescription().getKMRange()[0]);
310 }
311 if (collectionView.getCurrentKm() != -1) {
293 imgUrl += "&currentKm=" + collectionView.getCurrentKm(); 312 imgUrl += "&currentKm=" + collectionView.getCurrentKm();
294 } 313 }
295 314
296 return imgUrl; 315 return imgUrl;
297 } 316 }

http://dive4elements.wald.intevation.org