changeset 1287:95ecb98c6015

Added skeleton for editor window. flys-client/trunk@2873 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 30 Sep 2011 13:42:00 +0000
parents b643622d77fe
children 17bff7b27052
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java
diffstat 8 files changed, 136 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Sep 30 11:03:33 2011 +0000
+++ b/flys-client/ChangeLog	Fri Sep 30 13:42:00 2011 +0000
@@ -1,3 +1,21 @@
+2011-09-30  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Added skeleton for editor window.
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java:
+	  New. Skeleton for editor window.
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java:
+	  Set the collection view as attribute to have a parent for the
+	  style editor window.
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties:
+	  Added strings for the style editor window.
+
 2011-09-30  Raimund Renkert <raimund.renkert@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri Sep 30 11:03:33 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri Sep 30 13:42:00 2011 +0000
@@ -224,6 +224,10 @@
 
     String properties();
 
+    String label_ok();
+
+    String label_cancel();
+
     // OUTPUT TYPES
 
     String discharge_curve();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri Sep 30 11:03:33 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri Sep 30 13:42:00 2011 +0000
@@ -49,6 +49,8 @@
 search = Search
 discharge = FIXME(Name)
 properties = Properties
+label_ok = Ok
+label_cancel = Cancel
 
 dpLabelFrom = From
 dpUnitFrom = km
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri Sep 30 11:03:33 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri Sep 30 13:42:00 2011 +0000
@@ -49,6 +49,8 @@
 search = Suchbegriff
 discharge = Kennzeichnender Abfluss
 properties = Eigenschaften
+label_ok = Ok
+label_cancel = Abbrechen
 
 dpLabelFrom = Von
 dpUnitFrom = km
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri Sep 30 11:03:33 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri Sep 30 13:42:00 2011 +0000
@@ -49,6 +49,8 @@
 search = Search
 discharge = FIXME(Name)
 properties = Properties
+label_ok = Ok
+label_cancel = Cancel
 
 dpLabelFrom = From
 dpUnitFrom = km
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java	Fri Sep 30 11:03:33 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java	Fri Sep 30 13:42:00 2011 +0000
@@ -142,6 +142,7 @@
         }
         else {
             ctp = new ChartThemePanel(collection, mode);
+            ctp.setCollectionView(this.view);
         }
 
         ctp.addRedrawRequestHandler(this);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java	Fri Sep 30 11:03:33 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java	Fri Sep 30 13:42:00 2011 +0000
@@ -28,6 +28,7 @@
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.ui.ThemePanel;
 import de.intevation.flys.client.client.Config;
+import de.intevation.flys.client.client.ui.CollectionView;
 
 import de.intevation.flys.client.client.services.FeedService;
 import de.intevation.flys.client.client.services.FeedServiceAsync;
@@ -45,6 +46,9 @@
     /** The collection */
     protected Collection collection;
 
+    /** The collection view*/
+    protected CollectionView view;
+
     /** The service used to get collection item attributes. */
     protected CollectionItemAttributeServiceAsync itemAttributeService =
         GWT.create(CollectionItemAttributeService.class);
@@ -162,8 +166,18 @@
                 }
                 public void onSuccess(CollectionItemAttribute cia) {
                     GWT.log("Successfully loaded collectionitem attributes.");
+                    StyleEditorWindow win = new StyleEditorWindow(
+                        collection,
+                        cia);
+                    win.setCollectionView(view);
+                    win.show();
                 }
             });
     }
+
+
+    public void setCollectionView (CollectionView view) {
+        this.view = view;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java	Fri Sep 30 13:42:00 2011 +0000
@@ -0,0 +1,93 @@
+package de.intevation.flys.client.client.ui.chart;
+
+import com.google.gwt.core.client.GWT;
+
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.Button;
+
+import com.smartgwt.client.widgets.events.ClickEvent;
+import com.smartgwt.client.widgets.events.ClickHandler;
+
+import de.intevation.flys.client.shared.model.Collection;
+import de.intevation.flys.client.shared.model.CollectionItemAttribute;
+import de.intevation.flys.client.client.ui.CollectionView;
+
+import de.intevation.flys.client.client.FLYSConstants;
+
+/**
+ * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
+ */
+public class StyleEditorWindow
+extends Window
+implements ClickHandler
+{
+    /** The interface that provides i18n messages. */
+    protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
+
+    /** The collection */
+    protected Collection collection;
+
+    /** The parent collection view */
+    protected CollectionView view;
+
+    /** The attributes */
+    protected CollectionItemAttribute attributes;
+
+    /** Main layout */
+    protected VLayout layout;
+
+
+    public StyleEditorWindow (
+        Collection collection,
+        CollectionItemAttribute attributes)
+    {
+        this.collection = collection;
+        this.attributes = attributes;
+        this.layout = new VLayout();
+
+        init();
+        initPanels();
+    }
+
+
+    protected void init() {
+        setTitle(MSG.properties());
+        setWidth(250);
+
+        setCanDragReposition(true);
+        setCanDragResize(true);
+        setKeepInParentRect(true);
+
+        layout.setWidth100();
+        layout.setHeight100();
+
+    }
+
+
+    protected void initPanels() {
+        HLayout buttons = new HLayout();
+        Button accept = new Button(MSG.label_ok());
+        Button cancel = new Button(MSG.label_cancel());
+        cancel.addClickHandler(this);
+
+
+        buttons.addMember(accept);
+        buttons.addMember(cancel);
+        layout.addMember(buttons);
+
+        addItem(layout);
+    }
+
+
+    public void setCollectionView (CollectionView view) {
+        this.view = view;
+        setParentElement(this.view.getParentElement());
+    }
+
+
+    public void onClick(ClickEvent event) {
+        this.hide();
+    }
+}

http://dive4elements.wald.intevation.org