# HG changeset patch # User Felix Wolfsteller # Date 1359457512 -3600 # Node ID 8cbea3354ac500248e7e8ae754277529897a9aaa # Parent ad9f1bdd51babeaae9dbadb2a0b4dddcd3cdcf6c [branch:dc-km-filter] DatacageWindow: Send from/to-km to datacage. diff -r ad9f1bdd51ba -r 8cbea3354ac5 flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java Tue Jan 29 11:49:55 2013 +0100 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java Tue Jan 29 12:05:12 2013 +0100 @@ -1,6 +1,7 @@ package de.intevation.flys.client.client.ui; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import com.google.gwt.core.client.GWT; @@ -68,11 +69,37 @@ setWidth(400); setHeight(500); + String startKm = + artifact.getArtifactDescription().getDataValueAsString("ld_from"); + String endKm = + artifact.getArtifactDescription().getDataValueAsString("ld_to"); + String parameter = "load-system:true"; + + if (startKm == null || startKm.equals("") || endKm == null + || endKm.equals("")) { + String locations = + artifact.getArtifactDescription().getDataValueAsString("ld_locations"); + if (locations != null && !locations.equals("")) { + String[] ls = locations.split(" "); + Double locs[] = new Double[ls.length]; + for (int i = 0; i < ls.length ; i++) { + locs[i] = Double.parseDouble(ls[i]); + } + Arrays.sort(locs); + parameter = parameter + ";startkm:" + locs[0] + + ";endkm:" + locs[locs.length-1]; + } + } + else { + parameter = parameter + ";startkm:" + startKm + + ";endkm:" + endKm; + } + GWT.log("parameter " + parameter); DatacageWidget dw = new DatacageWidget( artifact, user, outs, - "load-system:true", + parameter, true); dw.addDatacageHandler(this); dw.addDatacageDoubleClickHandler(this);