comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/SingleLocationPanel.java @ 4184:03de5c424f95

Fix warnings and minor TODOs in flys-client.
author Christian Lins <christian.lins@intevation.de>
date Fri, 19 Oct 2012 09:29:57 +0200
parents e703555f8da1
children 480de0dbca8e
comparison
equal deleted inserted replaced
4183:1755a1bfe5ce 4184:03de5c424f95
1 package de.intevation.flys.client.client.ui; 1 package de.intevation.flys.client.client.ui;
2 2
3 import com.google.gwt.i18n.client.NumberFormat; 3 import com.google.gwt.i18n.client.NumberFormat;
4 4
5 import com.smartgwt.client.data.Record; 5 import com.smartgwt.client.data.Record;
6
7 import com.smartgwt.client.widgets.grid.events.RecordClickEvent; 6 import com.smartgwt.client.widgets.grid.events.RecordClickEvent;
8 7
9 import de.intevation.flys.client.shared.model.Data; 8 import de.intevation.flys.client.shared.model.Data;
10 9
11 import java.util.ArrayList; 10 import java.util.ArrayList;
15 * This UIProvider creates a widget to enter a single location (km). 14 * This UIProvider creates a widget to enter a single location (km).
16 */ 15 */
17 public class SingleLocationPanel 16 public class SingleLocationPanel
18 extends MultipleLocationPanel 17 extends MultipleLocationPanel
19 { 18 {
19 private static final long serialVersionUID = -300641333561787454L;
20
21
20 /** 22 /**
21 * Creates a new SingleLocationPanel instance. 23 * Creates a new SingleLocationPanel instance.
22 */ 24 */
23 public SingleLocationPanel() { 25 public SingleLocationPanel() {
24 picker = new LocationPicker(this); 26 picker = new LocationPicker(this);
76 /** 78 /**
77 * This method returns the selected data. 79 * This method returns the selected data.
78 * 80 *
79 * @return the selected/inserted data. 81 * @return the selected/inserted data.
80 */ 82 */
83 @Override
81 public Data[] getData() { 84 public Data[] getData() {
82 saveLocationValues(locationPanel); 85 saveLocationValues(locationPanel);
83 double[] values = getLocationValues(); 86 double[] values = getLocationValues();
84 Data[] data = new Data[values.length+1]; 87 Data[] data = new Data[values.length+1];
85 88
99 /** 102 /**
100 * Callback when an item from the input helper was clicked. 103 * Callback when an item from the input helper was clicked.
101 * Set the respective km-value in the location value field. 104 * Set the respective km-value in the location value field.
102 * @param e event passed. 105 * @param e event passed.
103 */ 106 */
107 @Override
104 public void onRecordClick (RecordClickEvent e) { 108 public void onRecordClick (RecordClickEvent e) {
105 Record record = e.getRecord(); 109 Record record = e.getRecord();
106 double[] selected = new double[1]; 110 double[] selected = new double[1];
107 try { 111 try {
108 selected[0] = 112 selected[0] =
113 } 117 }
114 setLocationValues(selected); 118 setLocationValues(selected);
115 } 119 }
116 120
117 121
122 @Override
118 protected String getLabelString() { 123 protected String getLabelString() {
119 return MSG.single_location(); 124 return MSG.single_location();
120 } 125 }
121 } 126 }
122 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 127 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org