comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java @ 4183:1755a1bfe5ce

Merged
author Christian Lins <christian.lins@intevation.de>
date Fri, 19 Oct 2012 09:20:52 +0200
parents 9be8d7942284
children 79878efbdf07
comparison
equal deleted inserted replaced
4182:ad2489b595d7 4183:1755a1bfe5ce
267 * GWT Tree.treeItemIterator returns another TreeItem for each 267 * GWT Tree.treeItemIterator returns another TreeItem for each
268 * GaugeInfoItem */ 268 * GaugeInfoItem */
269 if (item instanceof GaugeInfoItem) { 269 if (item instanceof GaugeInfoItem) {
270 boolean setstate = false; 270 boolean setstate = false;
271 GaugeInfoItem gitem = (GaugeInfoItem)item; 271 GaugeInfoItem gitem = (GaugeInfoItem)item;
272 if (end == null) { 272 if (end == null && gitem.getStart() != null) {
273 if (gitem.getStart() >= start) { 273 if (gitem.getStart() >= start) {
274 setstate = true; 274 setstate = true;
275 } 275 }
276 } 276 }
277 else { 277 else {
289 item.setState(setstate); 289 item.setState(setstate);
290 } 290 }
291 } 291 }
292 } 292 }
293 293
294 /**
295 * Open Gauge entry if a location fits to the gauge
296 */
294 public void openOnLocations(List<Double> locations) { 297 public void openOnLocations(List<Double> locations) {
295 GWT.log("GaugeTree - openOnLocations " + locations + " " + 298 GWT.log("GaugeTree - openOnLocations " + locations + " " +
296 tree.getItemCount()); 299 tree.getItemCount());
297 300
298 if (locations == null || locations.isEmpty()) { 301 if (locations == null || locations.isEmpty()) {
306 boolean isset = false; 309 boolean isset = false;
307 for (Double location: locations) { 310 for (Double location: locations) {
308 if (locations == null) { 311 if (locations == null) {
309 continue; 312 continue;
310 } 313 }
311 if (location >= gitem.getStart() && 314
312 location <= gitem.getEnd()) { 315 Double start = gitem.getStart();
316 Double end = gitem.getEnd();
317 if (start == null || end == null) {
318 // should not occur but avoid NullPointerException
319 continue;
320 }
321
322 if (location >= start && location <= end) {
313 isset = true; 323 isset = true;
314 break; 324 break;
315 } 325 }
316 } 326 }
317 item.setState(isset); 327 item.setState(isset);
318 } 328 }
319 } 329 }
320 } 330 }

http://dive4elements.wald.intevation.org