Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LocationDistancePanel.java @ 8262:9321b0cd4ad4
Fixed location distance panel. TODO: Switch to location table and select tabs.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 12 Sep 2014 08:42:41 +0200 |
parents | 48d8dba891f6 |
children | 75b84f139c1b |
comparison
equal
deleted
inserted
replaced
8261:229fce4a1d3e | 8262:9321b0cd4ad4 |
---|---|
707 // the initial view will display the location input mode | 707 // the initial view will display the location input mode |
708 locationPanel = new DoubleArrayPanel( | 708 locationPanel = new DoubleArrayPanel( |
709 MESSAGES.unitLocation(), | 709 MESSAGES.unitLocation(), |
710 getLocationValues(), | 710 getLocationValues(), |
711 this); | 711 this); |
712 distancePanel = new DoubleRangePanel( | |
713 MESSAGES.unitFrom(), MESSAGES.unitTo(), MESSAGES.unitWidth(), | |
714 getFrom(), getTo(), getStep(), | |
715 400, | |
716 this); | |
717 | |
712 container.addMember(locationPanel); | 718 container.addMember(locationPanel); |
719 container.addMember(distancePanel); | |
720 container.hideMember(locationPanel); | |
713 | 721 |
714 layout.addMember(checkboxPanel); | 722 layout.addMember(checkboxPanel); |
715 layout.addMember(container); | 723 layout.addMember(container); |
716 | 724 |
717 container.setMembersMargin(30); | 725 container.setMembersMargin(30); |
1146 | 1154 |
1147 /** | 1155 /** |
1148 * Activates the location panel. | 1156 * Activates the location panel. |
1149 */ | 1157 */ |
1150 protected void enableLocationPanel() { | 1158 protected void enableLocationPanel() { |
1151 locationPanel = new DoubleArrayPanel( | 1159 container.hideMember(distancePanel); |
1152 MESSAGES.unitLocation(), | 1160 container.showMember(locationPanel); |
1153 getLocationValues(), | |
1154 this); | |
1155 | |
1156 container.removeMembers(container.getMembers()); | |
1157 container.addMember(locationPanel); | |
1158 } | 1161 } |
1159 | 1162 |
1160 | 1163 |
1161 /** | 1164 /** |
1162 * Activates the distance panel. | 1165 * Activates the distance panel. |
1163 */ | 1166 */ |
1164 protected void enableDistancePanel() { | 1167 protected void enableDistancePanel() { |
1165 distancePanel = new DoubleRangePanel( | 1168 container.hideMember(locationPanel); |
1166 MESSAGES.unitFrom(), MESSAGES.unitTo(), MESSAGES.unitWidth(), | 1169 container.showMember(distancePanel); |
1167 getFrom(), getTo(), getStep(), | |
1168 400, | |
1169 this); | |
1170 | |
1171 container.removeMembers(container.getMembers()); | |
1172 container.addMember(distancePanel); | |
1173 } | 1170 } |
1174 | 1171 |
1175 | 1172 |
1176 /** | 1173 /** |
1177 * This method switches the input mode between location and distance input. | 1174 * This method switches the input mode between location and distance input. |
1184 | 1181 |
1185 if (value == null) { | 1182 if (value == null) { |
1186 return; | 1183 return; |
1187 } | 1184 } |
1188 if (value.equals(FIELD_VALUE_LOCATION)) { | 1185 if (value.equals(FIELD_VALUE_LOCATION)) { |
1186 event.getItem().setValue(FIELD_VALUE_LOCATION); | |
1189 enableLocationPanel(); | 1187 enableLocationPanel(); |
1190 filterDescription.clear(); | 1188 filterDescription.clear(); |
1191 filterRange.clear(); | 1189 filterRange.clear(); |
1192 filterResultCount.setValue(""); | 1190 filterResultCount.setValue(""); |
1193 | 1191 |
1203 | 1201 |
1204 // Bring this tab to front. | 1202 // Bring this tab to front. |
1205 inputTables.selectTab(0); | 1203 inputTables.selectTab(0); |
1206 } | 1204 } |
1207 else { | 1205 else { |
1206 event.getItem().setValue(FIELD_VALUE_DISTANCE); | |
1208 enableDistancePanel(); | 1207 enableDistancePanel(); |
1209 filterDescription.clear(); | 1208 filterDescription.clear(); |
1210 filterRange.clear(); | 1209 filterRange.clear(); |
1211 filterResultCount.setValue(""); | 1210 filterResultCount.setValue(""); |
1212 | 1211 |