comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java @ 51:a2923d63f530

Introduced a data structure DataList to manage to list of Data objects of a single state. flys-client/trunk@1505 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 17 Mar 2011 16:44:51 +0000
parents d573ae975330
children 3d5d7788d471
comparison
equal deleted inserted replaced
50:827eb4e06ebf 51:a2923d63f530
17 import com.smartgwt.client.widgets.layout.HLayout; 17 import com.smartgwt.client.widgets.layout.HLayout;
18 import com.smartgwt.client.widgets.layout.VLayout; 18 import com.smartgwt.client.widgets.layout.VLayout;
19 19
20 import de.intevation.flys.client.shared.model.Data; 20 import de.intevation.flys.client.shared.model.Data;
21 import de.intevation.flys.client.shared.model.DataItem; 21 import de.intevation.flys.client.shared.model.DataItem;
22 import de.intevation.flys.client.shared.model.DataList;
22 import de.intevation.flys.client.shared.model.DefaultData; 23 import de.intevation.flys.client.shared.model.DefaultData;
23 import de.intevation.flys.client.shared.model.DefaultDataItem; 24 import de.intevation.flys.client.shared.model.DefaultDataItem;
24 import de.intevation.flys.client.client.FLYSMessages; 25 import de.intevation.flys.client.client.FLYSMessages;
25 26
26 27
87 * 88 *
88 * @param data The data that might be inserted. 89 * @param data The data that might be inserted.
89 * 90 *
90 * @return a panel. 91 * @return a panel.
91 */ 92 */
92 public Canvas create(Data data) { 93 public Canvas create(DataList data) {
93 VLayout layout = new VLayout(); 94 VLayout layout = new VLayout();
94 95
95 Label label = new Label(MESSAGES.location_distance_state()); 96 Label label = new Label(MESSAGES.location_distance_state());
96 Canvas widget = createWidget(data); 97 Canvas widget = createWidget(data);
97 IButton submit = new IButton(MESSAGES.next(), this); 98 IButton submit = new IButton(MESSAGES.next(), this);
104 105
105 return layout; 106 return layout;
106 } 107 }
107 108
108 109
109 protected Canvas createWidget(Data data) { 110 protected Canvas createWidget(DataList data) {
110 VLayout layout = new VLayout(); 111 VLayout layout = new VLayout();
111 container = new HLayout(); 112 container = new HLayout();
112 Canvas checkboxPanel = createRadioButtonPanel(); 113 Canvas checkboxPanel = createRadioButtonPanel();
113 114
114 // the initial view will display the location input mode 115 // the initial view will display the location input mode
144 */ 145 */
145 protected Data getDataFrom() { 146 protected Data getDataFrom() {
146 String value = Double.valueOf(getFinalFrom()).toString(); 147 String value = Double.valueOf(getFinalFrom()).toString();
147 DataItem item = new DefaultDataItem("ld_from", "ld_from", value); 148 DataItem item = new DefaultDataItem("ld_from", "ld_from", value);
148 return new DefaultData( 149 return new DefaultData(
149 "ld_from", null, null, new DataItem[] { item }, null); 150 "ld_from", null, null, new DataItem[] { item });
150 } 151 }
151 152
152 153
153 /** 154 /**
154 * Returns the Data object for the 'to' attribute. 155 * Returns the Data object for the 'to' attribute.
157 */ 158 */
158 protected Data getDataTo() { 159 protected Data getDataTo() {
159 String value = Double.valueOf(getFinalTo()).toString(); 160 String value = Double.valueOf(getFinalTo()).toString();
160 DataItem item = new DefaultDataItem("ld_to", "ld_to", value); 161 DataItem item = new DefaultDataItem("ld_to", "ld_to", value);
161 return new DefaultData( 162 return new DefaultData(
162 "ld_to", null, null, new DataItem[] { item }, null); 163 "ld_to", null, null, new DataItem[] { item });
163 } 164 }
164 165
165 166
166 /** 167 /**
167 * Returns the Data object for the 'step' attribute. 168 * Returns the Data object for the 'step' attribute.
170 */ 171 */
171 protected Data getDataStep() { 172 protected Data getDataStep() {
172 String value = Double.valueOf(getFinalStep()).toString(); 173 String value = Double.valueOf(getFinalStep()).toString();
173 DataItem item = new DefaultDataItem("ld_step","ld_step", value); 174 DataItem item = new DefaultDataItem("ld_step","ld_step", value);
174 return new DefaultData( 175 return new DefaultData(
175 "ld_step", null, null, new DataItem[] { item }, null); 176 "ld_step", null, null, new DataItem[] { item });
176 } 177 }
177 178
178 179
179 /** 180 /**
180 * Returns the value of 'from' depending on the selected input mode. 181 * Returns the value of 'from' depending on the selected input mode.

http://dive4elements.wald.intevation.org