comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartPropertiesEditor.java @ 1431:987f95ceb623

Added property fields to the chart properties editor dialog. flys-client/trunk@3385 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 12 Dec 2011 09:02:13 +0000
parents 16b7adc66330
children 8da36efc839a
comparison
equal deleted inserted replaced
1430:6bb6d43eeb2d 1431:987f95ceb623
8 import com.smartgwt.client.widgets.tab.TabSet; 8 import com.smartgwt.client.widgets.tab.TabSet;
9 import com.smartgwt.client.widgets.tab.Tab; 9 import com.smartgwt.client.widgets.tab.Tab;
10 import com.smartgwt.client.widgets.layout.VLayout; 10 import com.smartgwt.client.widgets.layout.VLayout;
11 import com.smartgwt.client.widgets.layout.HLayout; 11 import com.smartgwt.client.widgets.layout.HLayout;
12 import com.smartgwt.client.widgets.Button; 12 import com.smartgwt.client.widgets.Button;
13 import com.smartgwt.client.widgets.Label;
13 import com.smartgwt.client.widgets.form.DynamicForm; 14 import com.smartgwt.client.widgets.form.DynamicForm;
14 import com.smartgwt.client.widgets.form.fields.FormItem; 15 import com.smartgwt.client.widgets.form.fields.FormItem;
15 import com.smartgwt.client.widgets.form.fields.CheckboxItem; 16 import com.smartgwt.client.widgets.form.fields.CheckboxItem;
16 import com.smartgwt.client.widgets.form.fields.SelectItem; 17 import com.smartgwt.client.widgets.form.fields.SelectItem;
17 import com.smartgwt.client.widgets.form.fields.StaticTextItem; 18 import com.smartgwt.client.widgets.form.fields.TextItem;
18 19
19 import com.smartgwt.client.widgets.events.ClickEvent; 20 import com.smartgwt.client.widgets.events.ClickEvent;
20 import com.smartgwt.client.widgets.events.ClickHandler; 21 import com.smartgwt.client.widgets.events.ClickHandler;
21 import com.smartgwt.client.widgets.form.events.ItemChangedEvent; 22 import com.smartgwt.client.widgets.form.events.ItemChangedEvent;
22 import com.smartgwt.client.widgets.form.events.ItemChangedHandler; 23 import com.smartgwt.client.widgets.form.events.ItemChangedHandler;
80 buttons.addMember(accept); 81 buttons.addMember(accept);
81 buttons.addMember(cancel); 82 buttons.addMember(cancel);
82 buttons.setAlign(Alignment.CENTER); 83 buttons.setAlign(Alignment.CENTER);
83 buttons.setHeight(30); 84 buttons.setHeight(30);
84 85
86 initChartPropertiesTab(diagram);
87 initAxesPropertiesTab(axes);
88 initLegendPropertiesTab(legend);
89
85 addItem(tabs); 90 addItem(tabs);
86 addItem(buttons); 91 addItem(buttons);
87 setWidth(300); 92 setWidth(340);
88 setHeight(410); 93 setHeight(470);
89 centerInPage(); 94 centerInPage();
90 } 95 }
91 96
92 /** 97 /**
93 * This method is called when the user aborts theming. 98 * This method is called when the user aborts theming.
94 * @param event The event. 99 * @param event The event.
95 */ 100 */
96 public void onClick(ClickEvent event) { 101 public void onClick(ClickEvent event) {
97 this.hide(); 102 this.hide();
98 } 103 }
104
105 /**
106 * Initializes the tab for general chart properties.
107 */
108 protected void initChartPropertiesTab(Tab t) {
109 VLayout properties = new VLayout();
110 DynamicForm form = new DynamicForm();
111
112 TextItem title = new TextItem ();
113 title.setTitle(MSG.chart_title());
114 title.setTitleAlign(Alignment.LEFT);
115
116 TextItem subTitle = new TextItem();
117 subTitle.setTitle(MSG.chart_subtitle());
118 subTitle.setTitleAlign(Alignment.LEFT);
119
120 CheckboxItem grid = new CheckboxItem("grid", MSG.grid());
121 grid.setLabelAsTitle(true);
122 grid.setTitleStyle("color:#000;");
123 grid.setTitleAlign(Alignment.LEFT);
124
125 CheckboxItem antialiasing = new CheckboxItem("antialiasing",
126 MSG.antialiasing());
127 antialiasing.setLabelAsTitle(true);
128 antialiasing.setTitleStyle("color:#000;");
129 antialiasing.setTitleAlign(Alignment.LEFT);
130
131 form.setFields(new FormItem[] {title, subTitle, grid, antialiasing});
132 properties.addMember(form);
133 t.setPane(properties);
134 }
135
136 /**
137 * Initializes the tab for axes properties.
138 */
139 protected void initAxesPropertiesTab(Tab t) {
140 VLayout properties = new VLayout();
141 Label scale = new Label(MSG.scale() + " :");
142 Label scale1 = new Label(MSG.scale() + " :");
143 Label scale2 = new Label(MSG.scale() + " :");
144 Label scale3 = new Label(MSG.scale() + " :");
145 scale.setHeight(25);
146 scale1.setHeight(25);
147 scale2.setHeight(25);
148 scale3.setHeight(25);
149
150 DynamicForm xform1 = new DynamicForm();
151 DynamicForm xform2 = new DynamicForm();
152 xform2.setNumCols(6);
153
154 Label x_axis = new Label (MSG.x_axis());
155 x_axis.setHeight(30);
156 HLayout x_scale = new HLayout();
157 TextItem xname = new TextItem ();
158 xname.setTitle(MSG.axis_name());
159 xname.setTitleAlign(Alignment.LEFT);
160
161 TextItem xrange1 = new TextItem();
162 xrange1.setTitle(MSG.chart_start());
163 xrange1.setTitleAlign(Alignment.LEFT);
164 xrange1.setWidth(50);
165
166 TextItem xrange2 = new TextItem();
167 xrange2.setTitle(MSG.chart_end());
168 xrange2.setTitleAlign(Alignment.LEFT);
169 xrange2.setWidth(50);
170
171 CheckboxItem xfix = new CheckboxItem("xfix", "Fix");
172 xfix.setLabelAsTitle(true);
173 xfix.setTitleStyle("color:#000;");
174 xfix.setTitleAlign(Alignment.LEFT);
175
176 xform1.setFields(xname);
177 xform2.setFields(xrange1, xrange2, xfix);
178 x_scale.addMember(scale);
179 x_scale.addMember(xform2);
180
181
182 DynamicForm y1form1 = new DynamicForm();
183 DynamicForm y1form2 = new DynamicForm();
184 y1form2.setNumCols(6);
185
186 Label y1_axis = new Label (MSG.y1_axis());
187 y1_axis.setHeight(30);
188 HLayout y1_scale = new HLayout();
189 TextItem y1name = new TextItem ();
190 y1name.setTitle(MSG.axis_name());
191 y1name.setTitleAlign(Alignment.LEFT);
192
193 TextItem y1range1 = new TextItem();
194 y1range1.setTitle(MSG.chart_start());
195 y1range1.setTitleAlign(Alignment.LEFT);
196 y1range1.setWidth(50);
197
198 TextItem y1range2 = new TextItem();
199 y1range2.setTitle(MSG.chart_end());
200 y1range2.setTitleAlign(Alignment.LEFT);
201 y1range2.setWidth(50);
202
203 CheckboxItem y1fix = new CheckboxItem("y1fix", "Fix");
204 y1fix.setLabelAsTitle(true);
205 y1fix.setTitleStyle("color:#000;");
206 y1fix.setTitleAlign(Alignment.LEFT);
207
208 y1form1.setFields(y1name);
209 y1form2.setFields(y1range1, y1range2, y1fix);
210 y1_scale.addMember(scale1);
211 y1_scale.addMember(y1form2);
212
213
214 DynamicForm y2form1 = new DynamicForm();
215 DynamicForm y2form2 = new DynamicForm();
216 y2form2.setNumCols(6);
217
218 Label y2_axis = new Label (MSG.y2_axis());
219 y2_axis.setHeight(30);
220 HLayout y2_scale = new HLayout();
221 TextItem y2name = new TextItem ();
222 y2name.setTitle(MSG.axis_name());
223 y2name.setTitleAlign(Alignment.LEFT);
224
225 TextItem y2range1 = new TextItem();
226 y2range1.setTitle(MSG.chart_start());
227 y2range1.setTitleAlign(Alignment.LEFT);
228 y2range1.setWidth(50);
229
230 TextItem y2range2 = new TextItem();
231 y2range2.setTitle(MSG.chart_end());
232 y2range2.setTitleAlign(Alignment.LEFT);
233 y2range2.setWidth(50);
234
235 CheckboxItem y2fix = new CheckboxItem("y2fix", "Fix");
236 y2fix.setLabelAsTitle(true);
237 y2fix.setTitleStyle("color:#000;");
238 y2fix.setTitleAlign(Alignment.LEFT);
239
240 y2form1.setFields(y2name);
241 y2form2.setFields(y2range1, y2range2, y2fix);
242 y2_scale.addMember(scale2);
243 y2_scale.addMember(y2form2);
244
245
246 DynamicForm y3form1 = new DynamicForm();
247 DynamicForm y3form2 = new DynamicForm();
248 y3form2.setNumCols(6);
249
250 Label y3_axis = new Label (MSG.y3_axis());
251 y3_axis.setHeight(30);
252 HLayout y3_scale = new HLayout();
253 TextItem y3name = new TextItem ();
254 y3name.setTitle(MSG.axis_name());
255 y3name.setTitleAlign(Alignment.LEFT);
256
257 TextItem y3range1 = new TextItem();
258 y3range1.setTitle(MSG.chart_start());
259 y3range1.setTitleAlign(Alignment.LEFT);
260 y3range1.setWidth(50);
261
262 TextItem y3range2 = new TextItem();
263 y3range2.setTitle(MSG.chart_end());
264 y3range2.setTitleAlign(Alignment.LEFT);
265 y3range2.setWidth(50);
266
267 CheckboxItem y3fix = new CheckboxItem("y3fix", "Fix");
268 y3fix.setLabelAsTitle(true);
269 y3fix.setTitleStyle("color:#000;");
270 y3fix.setTitleAlign(Alignment.LEFT);
271
272 y3form1.setFields(y3name);
273 y3form2.setFields(y3range1, y3range2, y3fix);
274 y3_scale.addMember(scale3);
275 y3_scale.addMember(y3form2);
276
277
278 properties.addMember(x_axis);
279 properties.addMember(xform1);
280 properties.addMember(x_scale);
281 properties.addMember(y1_axis);
282 properties.addMember(y1form1);
283 properties.addMember(y1_scale);
284 properties.addMember(y2_axis);
285 properties.addMember(y2form1);
286 properties.addMember(y2_scale);
287 properties.addMember(y3_axis);
288 properties.addMember(y3form1);
289 properties.addMember(y3_scale);
290
291 t.setPane(properties);
292 }
293
294 /**
295 * Initializes the tab for legend properties.
296 */
297 protected void initLegendPropertiesTab(Tab t) {
298 VLayout properties = new VLayout();
299 DynamicForm form = new DynamicForm();
300
301 TextItem name = new TextItem ();
302 name.setTitle(MSG.legend_name());
303 name.setTitleAlign(Alignment.LEFT);
304
305 CheckboxItem show = new CheckboxItem("show", MSG.show_legend());
306 show.setLabelAsTitle(true);
307 show.setTitleStyle("color:#000;");
308 show.setTitleAlign(Alignment.LEFT);
309
310 form.setFields(name, show);
311 properties.addMember(form);
312 t.setPane(properties);
313 }
314
99 } 315 }

http://dive4elements.wald.intevation.org