comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ManualWSPEditor.java @ 2927:f978058dc835

Nicen Manual WSP editor. flys-client/trunk@4825 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 28 Jun 2012 14:50:05 +0000
parents 6461b8dbe093
children f0c7c52203c0
comparison
equal deleted inserted replaced
2926:59491a730461 2927:f978058dc835
135 135
136 /** 136 /**
137 * Initialize the editor window and its components. 137 * Initialize the editor window and its components.
138 */ 138 */
139 protected void init() { 139 protected void init() {
140 setTitle(MSG.addpoints()); 140 setTitle(MSG.addWSP());
141 setCanDragReposition(true); 141 setCanDragReposition(true);
142 setCanDragResize(true); 142 setCanDragResize(true);
143 143
144 if(findManualPointsUUID() == null) { 144 if(findManualPointsUUID() == null) {
145 addArtifactCreateUI(); 145 addArtifactCreateUI();
167 HLayout buttons = new HLayout(); 167 HLayout buttons = new HLayout();
168 buttons.addMember(accept); 168 buttons.addMember(accept);
169 buttons.addMember(cancel); 169 buttons.addMember(cancel);
170 buttons.setAlign(Alignment.CENTER); 170 buttons.setAlign(Alignment.CENTER);
171 buttons.setHeight(30); 171 buttons.setHeight(30);
172
173 DynamicForm form = new DynamicForm();
174 valueInputPanel = new TextItem();
175 valueInputPanel.setTitle("wsp");
176 valueInputPanel.setShowTitle(false);
177 nameInputPanel = new TextItem();
178 nameInputPanel.setTitle("name");
179 nameInputPanel.setShowTitle(false);
180 form.setFields(valueInputPanel, nameInputPanel);
181
182 VLayout layout = new VLayout();
183 layout.addMember(form);
184 172
185 // Use X and Y as default fallback. 173 // Use X and Y as default fallback.
186 String yAxis = "Y"; 174 String yAxis = "Y";
187 175
188 // Get header text from collection settings. 176 // Get header text from collection settings.
191 if(axes != null) { 179 if(axes != null) {
192 for (Property p: axes) { 180 for (Property p: axes) {
193 PropertyGroup pg = (PropertyGroup)p; 181 PropertyGroup pg = (PropertyGroup)p;
194 StringProperty id = 182 StringProperty id =
195 (StringProperty)pg.getPropertyByName("id"); 183 (StringProperty)pg.getPropertyByName("id");
196 if (yAxis.equals("Y")) { 184 if (id.getValue().equals("W")) {
197 StringProperty name = 185 StringProperty name =
198 (StringProperty)pg.getPropertyByName("label"); 186 (StringProperty)pg.getPropertyByName("label");
199 yAxis = name.getValue(); 187 yAxis = name.getValue();
200 } 188 }
201 } 189 }
202 } 190 }
203 191
192 DynamicForm form = new DynamicForm();
193 valueInputPanel = new TextItem();
194 valueInputPanel.setTitle(yAxis);
195 valueInputPanel.setShowTitle(true);
196 nameInputPanel = new TextItem();
197 nameInputPanel.setTitle(MSG.pointname());
198 nameInputPanel.setShowTitle(true);
199 form.setFields(valueInputPanel, nameInputPanel);
200
201 VLayout layout = new VLayout();
202 layout.addMember(form);
204 203
205 // Find the artifacts uuid. 204 // Find the artifacts uuid.
206 // TODO this has been called already, why call it again? 205 // TODO this has been called already, why call it again?
207 findManualPointsUUID(); 206 findManualPointsUUID();
208 CollectionItem item = collection.getItem(uuid); 207 CollectionItem item = collection.getItem(uuid);
217 } 216 }
218 217
219 addItem(layout); 218 addItem(layout);
220 219
221 addItem(buttons); 220 addItem(buttons);
222 setWidth(380); 221 setWidth(360);
223 setHeight(470); 222 setHeight(120);
224 centerInPage(); 223 centerInPage();
225 } 224 }
226 225
227 226
228 /** 227 /**

http://dive4elements.wald.intevation.org