comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java @ 1450:bb91cdf8407b

Minor refactoring to ease addition of new style-fields (are now added automically). flys-client/trunk@3469 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 19 Dec 2011 16:18:53 +0000
parents bc06a671ef60
children bc830e564b6d
comparison
equal deleted inserted replaced
1449:8da36efc839a 1450:bb91cdf8407b
153 * @return The layout containing the UI elements. 153 * @return The layout containing the UI elements.
154 */ 154 */
155 protected VLayout createPropertyGrid() { 155 protected VLayout createPropertyGrid() {
156 VLayout properties = new VLayout(); 156 VLayout properties = new VLayout();
157 157
158 Theme t = facet.getTheme(); 158 Theme theme = facet.getTheme();
159 Style s = attributes.getStyle(t.getFacet(), t.getIndex()); 159 Style style = attributes.getStyle(theme.getFacet(), theme.getIndex());
160 160
161 StaticTextItem name = new StaticTextItem("name", "Name"); 161 StaticTextItem name = new StaticTextItem("name", "Name");
162 name.setValue(facet.getName()); 162 name.setValue(facet.getName());
163 name.setTitleStyle("color:#000; width:120px"); 163 name.setTitleStyle("color:#000; width:120px");
164 name.setTitleAlign(Alignment.LEFT); 164 name.setTitleAlign(Alignment.LEFT);
165 name.setDisabled(true); 165 name.setDisabled(true);
166 name.setShowDisabled(false); 166 name.setShowDisabled(false);
167 DynamicForm f = new DynamicForm(); 167 DynamicForm form = new DynamicForm();
168 f.setFields(name); 168 form.setFields(name);
169 properties.addMember(f); 169 properties.addMember(form);
170 170
171 String[] sets = {"showlines", 171 for (StyleSetting set: style.getSettings()) {
172 "showpoints",
173 "linetype",
174 "linesize",
175 "linecolor",
176 "font",
177 "textstyle",
178 "textsize",
179 "textcolor",
180 "textorientation",
181 "backgroundcolor",
182 "showbackground"};
183
184 for (int i = 0; i < sets.length; i ++) {
185 StyleSetting set = s.getSetting(sets[i]);
186 172
187 if (set == null) { 173 if (set == null) {
188 continue; 174 continue;
189 } 175 }
190 176
193 set.getName(), 179 set.getName(),
194 set.getType(), 180 set.getType(),
195 set.getDefaultValue()); 181 set.getDefaultValue());
196 properties.addMember(property); 182 properties.addMember(property);
197 } 183 }
184
198 return properties; 185 return properties;
199 } 186 }
200 187
201 188
202 /** 189 /**

http://dive4elements.wald.intevation.org