changeset 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 fa63366ba115
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java
diffstat 2 files changed, 45 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Dec 19 16:18:53 2011 +0000
+++ b/flys-client/ChangeLog	Mon Dec 19 16:34:41 2011 +0000
@@ -1,11 +1,22 @@
+2011-12-19	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	Restore functionality of hand-sorted properties in style dialog,
+	which was removed by last commit. Carry better variable naming
+	and feature of displaying not-whitelisted properties over.
+	Added comment to prevent other people from "optimizing".
+
+	* src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java:
+	  Add properties in defined order. Add properties that do not occur
+	  in ordered list last.
+
 2011-12-19	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Minor refactoring to ease addition of new (theme-style) settings.
 
-	* main/java/de/intevation/flys/client/shared/model/Style.java:
+	* src/main/java/de/intevation/flys/client/shared/model/Style.java:
 	  Added getter for list of settings.
 
-	* main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java:
+	* src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java:
 	  Minor renaming, consume list instead of whitequerying entries.
 
 2011-12-19  Ingo Weinzierl <ingo@intevation.de>
--- 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