comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java @ 568:1d20533a4ae3

Bring Oberkante and Unterkante into UI. flys-client/trunk@2116 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 14 Jun 2011 15:46:31 +0000
parents 9f16ac843dda
children 85d7cc0f2bab
comparison
equal deleted inserted replaced
567:d9fc58e30a53 568:1d20533a4ae3
193 distanceTable.setHeight100(); 193 distanceTable.setHeight100();
194 distanceTable.setEmptyMessage(MESSAGES.empty_table()); 194 distanceTable.setEmptyMessage(MESSAGES.empty_table());
195 195
196 ListGridField addDistance = new ListGridField ("", ""); 196 ListGridField addDistance = new ListGridField ("", "");
197 addDistance.setType (ListGridFieldType.ICON); 197 addDistance.setType (ListGridFieldType.ICON);
198 addDistance.setWidth ("30"); 198 addDistance.setWidth (20);
199 addDistance.addRecordClickHandler (new RecordClickHandler () { 199 addDistance.addRecordClickHandler (new RecordClickHandler () {
200 public void onRecordClick (RecordClickEvent e) { 200 public void onRecordClick (RecordClickEvent e) {
201 if (!isLocationMode ()) { 201 if (!isLocationMode ()) {
202 Record r = e.getRecord(); 202 Record r = e.getRecord();
203 double min = r.getAttributeAsDouble("from"); 203 double min = r.getAttributeAsDouble("from");
233 MESSAGES.description()); 233 MESSAGES.description());
234 ddescr.setType(ListGridFieldType.TEXT); 234 ddescr.setType(ListGridFieldType.TEXT);
235 ddescr.setWidth("*"); 235 ddescr.setWidth("*");
236 ListGridField from = new ListGridField("from", MESSAGES.from()); 236 ListGridField from = new ListGridField("from", MESSAGES.from());
237 from.setType(ListGridFieldType.TEXT); 237 from.setType(ListGridFieldType.TEXT);
238 from.setWidth(75); 238 from.setWidth(40);
239 ListGridField to = new ListGridField("to", MESSAGES.to()); 239 ListGridField to = new ListGridField("to", MESSAGES.to());
240 to.setType(ListGridFieldType.TEXT); 240 to.setType(ListGridFieldType.TEXT);
241 to.setWidth(75); 241 to.setWidth(40);
242 ListGridField dside = new ListGridField("riverside", 242 ListGridField dside = new ListGridField("riverside",
243 MESSAGES.riverside()); 243 MESSAGES.riverside());
244 dside.setType(ListGridFieldType.TEXT); 244 dside.setType(ListGridFieldType.TEXT);
245 dside.setWidth(60); 245 dside.setWidth(40);
246 246
247 distanceTable.setFields(addDistance, ddescr, from, to, dside); 247 ListGridField bottom =
248 new ListGridField("bottom", MESSAGES.bottom_edge());
249 bottom.setType(ListGridFieldType.TEXT);
250 bottom.setWidth(30);
251
252 ListGridField top =
253 new ListGridField("top", MESSAGES.top_edge());
254 top.setType(ListGridFieldType.TEXT);
255 top.setWidth(30);
256
257 distanceTable.setFields(
258 addDistance, ddescr, from, to, dside, bottom, top);
248 } 259 }
249 260
250 261
251 /** 262 /**
252 * This method creates a table that contains the location values. 263 * This method creates a table that contains the location values.
258 locationsTable.setHeight100(); 269 locationsTable.setHeight100();
259 locationsTable.setEmptyMessage(MESSAGES.empty_table()); 270 locationsTable.setEmptyMessage(MESSAGES.empty_table());
260 271
261 ListGridField addLocation = new ListGridField ("", ""); 272 ListGridField addLocation = new ListGridField ("", "");
262 addLocation.setType (ListGridFieldType.ICON); 273 addLocation.setType (ListGridFieldType.ICON);
263 addLocation.setWidth ("30"); 274 addLocation.setWidth (20);
275
264 addLocation.addRecordClickHandler (new RecordClickHandler () { 276 addLocation.addRecordClickHandler (new RecordClickHandler () {
265 public void onRecordClick (RecordClickEvent e) { 277 public void onRecordClick (RecordClickEvent e) {
266 ListGridRecord[] records = locationsTable.getSelection(); 278 ListGridRecord[] records = locationsTable.getSelection();
267 double[] selected; 279 double[] selected;
268 if (getLocationValues() != null) { 280 if (getLocationValues() != null) {
288 ldescr.setType(ListGridFieldType.TEXT); 300 ldescr.setType(ListGridFieldType.TEXT);
289 ldescr.setWidth("*"); 301 ldescr.setWidth("*");
290 ListGridField lside = new ListGridField("riverside", 302 ListGridField lside = new ListGridField("riverside",
291 MESSAGES.riverside()); 303 MESSAGES.riverside());
292 lside.setType(ListGridFieldType.TEXT); 304 lside.setType(ListGridFieldType.TEXT);
293 lside.setWidth(60); 305 lside.setWidth(40);
294 ListGridField loc = new ListGridField("from", MESSAGES.location()); 306 ListGridField loc = new ListGridField("from", MESSAGES.location());
295 loc.setType(ListGridFieldType.TEXT); 307 loc.setType(ListGridFieldType.TEXT);
296 loc.setWidth(80); 308 loc.setWidth(40);
297 locationsTable.setFields(addLocation, ldescr, loc, lside); 309
310 ListGridField bottom =
311 new ListGridField("bottom", MESSAGES.bottom_edge());
312 bottom.setType(ListGridFieldType.TEXT);
313 bottom.setWidth(30);
314
315 ListGridField top =
316 new ListGridField("top", MESSAGES.top_edge());
317 top.setType(ListGridFieldType.TEXT);
318 top.setWidth(30);
319
320 locationsTable.setFields(addLocation, ldescr, loc, lside, bottom, top);
298 } 321 }
299 322
300 323
301 /** 324 /**
302 * This method creates a table that contains the location values. 325 * This method creates a table that contains the location values.
310 locationDistanceTable.setHeight100(); 333 locationDistanceTable.setHeight100();
311 locationDistanceTable.setEmptyMessage(MESSAGES.empty_table()); 334 locationDistanceTable.setEmptyMessage(MESSAGES.empty_table());
312 335
313 ListGridField addfrom = new ListGridField ("", ""); 336 ListGridField addfrom = new ListGridField ("", "");
314 addfrom.setType (ListGridFieldType.ICON); 337 addfrom.setType (ListGridFieldType.ICON);
315 addfrom.setWidth ("30"); 338 addfrom.setWidth (20);
316 addfrom.setCellIcon (IMAGES.markerGreen ().getURL ()); 339 addfrom.setCellIcon (IMAGES.markerGreen ().getURL ());
317 340
318 ListGridField addto2 = new ListGridField ("", ""); 341 ListGridField addto2 = new ListGridField ("", "");
319 addto2.setType (ListGridFieldType.ICON); 342 addto2.setType (ListGridFieldType.ICON);
320 addto2.setWidth ("30"); 343 addto2.setWidth (20);
321 addto2.setCellIcon (IMAGES.markerRed ().getURL ()); 344 addto2.setCellIcon (IMAGES.markerRed ().getURL ());
322 345
323 346
324 ListGridField ldescr = new ListGridField("description", 347 ListGridField ldescr = new ListGridField("description",
325 MESSAGES.description()); 348 MESSAGES.description());
326 ldescr.setType(ListGridFieldType.TEXT); 349 ldescr.setType(ListGridFieldType.TEXT);
327 ldescr.setWidth("*"); 350 ldescr.setWidth("*");
328 ListGridField lside = new ListGridField("riverside", 351 ListGridField lside = new ListGridField("riverside",
329 MESSAGES.riverside()); 352 MESSAGES.riverside());
330 lside.setType(ListGridFieldType.TEXT); 353 lside.setType(ListGridFieldType.TEXT);
331 lside.setWidth(60); 354 lside.setWidth(40);
332 ListGridField loc = new ListGridField("from", MESSAGES.location()); 355 ListGridField loc = new ListGridField("from", MESSAGES.location());
333 loc.setType(ListGridFieldType.TEXT); 356 loc.setType(ListGridFieldType.TEXT);
334 loc.setWidth(80); 357 loc.setWidth(40);
335 locationDistanceTable.addCellClickHandler (new CellClickHandler () { 358 locationDistanceTable.addCellClickHandler (new CellClickHandler () {
336 public void onCellClick (CellClickEvent e) { 359 public void onCellClick (CellClickEvent e) {
337 if (e.getColNum() == 0) { 360 if (e.getColNum() == 0) {
338 Record r = e.getRecord (); 361 Record r = e.getRecord ();
339 double fromvalue = r.getAttributeAsDouble ("from"); 362 double fromvalue = r.getAttributeAsDouble ("from");
346 double tovalue = r.getAttributeAsDouble ("to"); 369 double tovalue = r.getAttributeAsDouble ("to");
347 setDistanceValues (fromvalue, tovalue); 370 setDistanceValues (fromvalue, tovalue);
348 } 371 }
349 } 372 }
350 }); 373 });
351 locationDistanceTable.setFields(addfrom, addto2, ldescr, loc, lside); 374 ListGridField bottom =
375 new ListGridField("bottom", MESSAGES.bottom_edge());
376 bottom.setType(ListGridFieldType.TEXT);
377 bottom.setWidth(30);
378
379 ListGridField top =
380 new ListGridField("top", MESSAGES.top_edge());
381 top.setType(ListGridFieldType.TEXT);
382 top.setWidth(30);
383
384 locationDistanceTable.setFields(
385 addfrom, addto2, ldescr, loc, lside, bottom, top);
352 } 386 }
353 387
354 388
355 public Canvas createOld(DataList dataList) { 389 public Canvas createOld(DataList dataList) {
356 List<Data> items = dataList.getAll(); 390 List<Data> items = dataList.getAll();

http://dive4elements.wald.intevation.org