comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java @ 4899:8cbea3354ac5 dc-km-filter

[branch:dc-km-filter] DatacageWindow: Send from/to-km to datacage.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 29 Jan 2013 12:05:12 +0100
parents d5f5bdaca316
children
comparison
equal deleted inserted replaced
4898:ad9f1bdd51ba 4899:8cbea3354ac5
1 package de.intevation.flys.client.client.ui; 1 package de.intevation.flys.client.client.ui;
2 2
3 import java.util.ArrayList; 3 import java.util.ArrayList;
4 import java.util.Arrays;
4 import java.util.List; 5 import java.util.List;
5 6
6 import com.google.gwt.core.client.GWT; 7 import com.google.gwt.core.client.GWT;
7 import com.google.gwt.user.client.rpc.AsyncCallback; 8 import com.google.gwt.user.client.rpc.AsyncCallback;
8 9
66 this.inProgress = 0; 67 this.inProgress = 0;
67 68
68 setWidth(400); 69 setWidth(400);
69 setHeight(500); 70 setHeight(500);
70 71
72 String startKm =
73 artifact.getArtifactDescription().getDataValueAsString("ld_from");
74 String endKm =
75 artifact.getArtifactDescription().getDataValueAsString("ld_to");
76 String parameter = "load-system:true";
77
78 if (startKm == null || startKm.equals("") || endKm == null
79 || endKm.equals("")) {
80 String locations =
81 artifact.getArtifactDescription().getDataValueAsString("ld_locations");
82 if (locations != null && !locations.equals("")) {
83 String[] ls = locations.split(" ");
84 Double locs[] = new Double[ls.length];
85 for (int i = 0; i < ls.length ; i++) {
86 locs[i] = Double.parseDouble(ls[i]);
87 }
88 Arrays.sort(locs);
89 parameter = parameter + ";startkm:" + locs[0] +
90 ";endkm:" + locs[locs.length-1];
91 }
92 }
93 else {
94 parameter = parameter + ";startkm:" + startKm +
95 ";endkm:" + endKm;
96 }
97 GWT.log("parameter " + parameter);
71 DatacageWidget dw = new DatacageWidget( 98 DatacageWidget dw = new DatacageWidget(
72 artifact, 99 artifact,
73 user, 100 user,
74 outs, 101 outs,
75 "load-system:true", 102 parameter,
76 true); 103 true);
77 dw.addDatacageHandler(this); 104 dw.addDatacageHandler(this);
78 dw.addDatacageDoubleClickHandler(this); 105 dw.addDatacageDoubleClickHandler(this);
79 106
80 addItem(dw); 107 addItem(dw);

http://dive4elements.wald.intevation.org