changeset 1336:ceb989d64cd2

Request redraw on style attribute change. flys-client/trunk@2981 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Mon, 17 Oct 2011 10:07:48 +0000
parents 82c1b76fd854
children 9bf72f84728d
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java
diffstat 3 files changed, 34 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Oct 17 09:46:25 2011 +0000
+++ b/flys-client/ChangeLog	Mon Oct 17 10:07:48 2011 +0000
@@ -1,3 +1,14 @@
+2011-10-17  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Request redraw on attribute change.
+
+	* src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java:
+	  Made request redraw method public and added method to show editor
+	  window.
+
+	* src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java:
+	  Removed collection view, added theme panel. Request redraw on success.
+
 2011-10-17	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	Cosmetics, docs.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Mon Oct 17 09:46:25 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Mon Oct 17 10:07:48 2011 +0000
@@ -30,7 +30,7 @@
 
 import de.intevation.flys.client.client.services.CollectionItemAttributeServiceAsync;
 import de.intevation.flys.client.client.services.CollectionItemAttributeService;
-import de.intevation.flys.client.client.ui.CollectionView;
+import de.intevation.flys.client.client.ui.ThemePanel;
 
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.Config;
@@ -48,8 +48,8 @@
     /** The collection. */
     protected Collection collection;
 
-    /** The parent collection view. */
-    protected CollectionView view;
+    /** The parent ThemePanel. */
+    protected ThemePanel panel;
 
     /** The attributes. */
     protected CollectionItemAttribute attributes;
@@ -115,9 +115,8 @@
     }
 
 
-    public void setCollectionView (CollectionView view) {
-        this.view = view;
-        setParentElement(this.view.getParentElement());
+    public void setThemePanel (ThemePanel panel) {
+        this.panel = panel;
     }
 
 
@@ -154,6 +153,7 @@
         return properties;
     }
 
+
     protected DynamicForm createPropertyUI(
         String dname,
         String name,
@@ -200,7 +200,6 @@
             public void onItemChanged(ItemChangedEvent e) {
                 String name = e.getItem().getName();
                 String newValue = e.getNewValue().toString();
-                GWT.log("changed: " + name);
                 setNewValue(name, newValue);
             }
         });
@@ -263,6 +262,7 @@
                 }
                 public void onSuccess(Void v) {
                     GWT.log("Successfully saved collection item attributes.");
+                    panel.requestRedraw();
                 }
             });
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java	Mon Oct 17 09:46:25 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ThemePanel.java	Mon Oct 17 10:07:48 2011 +0000
@@ -143,7 +143,7 @@
     /**
      * Request a redraw of e.g. a Chart.
      */
-    protected void requestRedraw() {
+    public void requestRedraw() {
         for (RedrawRequestHandler handler: redrawRequestHandlers) {
             handler.onRedrawRequest(new RedrawRequestEvent(Type.RESET));
         }
@@ -552,14 +552,23 @@
                 }
                 public void onSuccess(CollectionItemAttribute cia) {
                     GWT.log("Successfully loaded collectionitem attributes.");
-                    StyleEditorWindow win = new StyleEditorWindow(
-                        collection,
-                        cia,
-                        record);
-                    win.setCollectionView(view);
-                    win.show();
+                    showStyleEditor(cia, record);
                 }
             });
     }
+
+
+    protected void showStyleEditor(
+        CollectionItemAttribute cia,
+        FacetRecord record)
+    {
+        StyleEditorWindow win = new StyleEditorWindow(
+            collection,
+            cia,
+            record);
+        win.setParentElement(view.getParentElement());
+        win.setThemePanel(this);
+        win.show();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org