diff flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java @ 1451:bc830e564b6d

Restore feature that was optimized away by last commit. flys-client/trunk@3470 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 19 Dec 2011 16:34:41 +0000
parents bb91cdf8407b
children 2f525f54e429
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Mon Dec 19 16:18:53 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Mon Dec 19 16:34:41 2011 +0000
@@ -1,5 +1,6 @@
 package de.intevation.flys.client.client.ui;
 
+import java.util.Arrays;
 import java.util.LinkedHashMap;
 
 import com.google.gwt.core.client.GWT;
@@ -168,9 +169,39 @@
         form.setFields(name);
         properties.addMember(form);
 
+        // Done via array to keep the order.
+        String[] sets = {"showlines",
+                         "showpoints",
+                         "linetype",
+                         "linesize",
+                         "linecolor",
+                         "font",
+                         "textstyle",
+                         "textsize",
+                         "textcolor",
+                         "textorientation",
+                         "backgroundcolor",
+                         "showbackground"};
+
+        for (String settingName: sets) {
+            StyleSetting set = style.getSetting(settingName);
+
+            if (set == null) {
+                continue;
+            }
+
+            DynamicForm property = createPropertyUI(
+                set.getDisplayName(),
+                set.getName(),
+                set.getType(),
+                set.getDefaultValue());
+            properties.addMember(property);
+        }
+
+        // Add settings not in whitelist above.
         for (StyleSetting set: style.getSettings()) {
 
-            if (set == null) {
+            if (Arrays.asList(sets).contains(set.getName()) || set == null) {
                 continue;
             }
 

http://dive4elements.wald.intevation.org