changeset 45:f99c5f8e4672

Some GUI improvements in the Location/Distance, W/Q and Module panels. flys-client/trunk@1490 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 17 Mar 2011 09:54:05 +0000
parents 3853210f2d18
children 0d4795b4f284
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java
diffstat 4 files changed, 70 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 17 09:29:10 2011 +0000
+++ b/flys-client/ChangeLog	Thu Mar 17 09:54:05 2011 +0000
@@ -1,3 +1,15 @@
+2011-03-17  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java:
+	  Defined the 'WINFO' plugin as default plugin. The initial view will
+	  display a preselcted winfo radio button.
+
+	* src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java:
+	  Added the missing 'next' button.
+
+	* src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java:
+	  Added the ClickHandler to the 'next' button.
+
 2011-03-17  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Thu Mar 17 09:29:10 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Thu Mar 17 09:54:05 2011 +0000
@@ -8,6 +8,7 @@
 
 import com.smartgwt.client.types.TitleOrientation;
 import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.IButton;
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.form.DynamicForm;
 import com.smartgwt.client.widgets.form.fields.events.BlurHandler;
@@ -93,13 +94,32 @@
     public Canvas create(Data data) {
         VLayout layout = new VLayout();
 
-        Label label          = new Label(MESSAGES.location_distance_state());
-        container            = new HLayout();
-        Canvas checkboxPanel = createRadioButtonPanel();
+        Label label    = new Label(MESSAGES.location_distance_state());
+        Canvas widget  = createWidget(data);
+        IButton submit = new IButton(MESSAGES.next(), this);
 
         label.setHeight(25);
 
         layout.addMember(label);
+        layout.addMember(widget);
+        layout.addMember(submit);
+
+        return layout;
+    }
+
+
+    protected Canvas createWidget(Data data) {
+        VLayout layout       = new VLayout();
+        container            = new HLayout();
+        Canvas checkboxPanel = createRadioButtonPanel();
+
+        // the initial view will display the location input mode
+        Canvas locationPanel = new DoubleArrayPanel(
+                MESSAGES.unitLocation(),
+                getLocationValues(),
+                this);
+        container.addMember(locationPanel);
+
         layout.addMember(checkboxPanel);
         layout.addMember(container);
 
@@ -205,10 +225,14 @@
         values.put(FIELD_LOCATION, MESSAGES.location());
         values.put(FIELD_DISTANCE, MESSAGES.distance());
 
+        LinkedHashMap initial = new LinkedHashMap();
+        initial.put("mode", FIELD_LOCATION);
+
         radio.setValueMap(values);
         radio.addChangeHandler(this);
 
         mode.setFields(radio);
+        mode.setValues(initial);
 
         return mode;
     }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java	Thu Mar 17 09:29:10 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ModuleSelection.java	Thu Mar 17 09:54:05 2011 +0000
@@ -1,5 +1,7 @@
 package de.intevation.flys.client.client.ui;
 
+import java.util.LinkedHashMap;
+
 import com.google.gwt.core.client.GWT;
 
 import com.smartgwt.client.widgets.Canvas;
@@ -30,6 +32,23 @@
     /** The message class that provides i18n strings.*/
     protected FLYSMessages MESSAGES = GWT.create(FLYSMessages.class);
 
+
+    /** Constant field name for the plugin selection.*/
+    public static final String FIELD_PLUGIN = "plugin";
+
+    /** Constant value for the WINFO plugin.*/
+    public static final String FIELD_PLUGIN_WINFO = "winfo";
+
+    /** Constant value for the MINFO plugin.*/
+    public static final String FIELD_PLUGIN_MINFO = "minfo";
+
+    /** Constant value for the MAP plugin.*/
+    public static final String FIELD_PLUGIN_MAP   = "map";
+
+    /** Constant value for the FIX plugin.*/
+    public static final String FIELD_PLUGIN_FIX   = "fix";
+
+
     /** The module checkboxes.*/
     protected RadioGroupItem radio;
 
@@ -84,15 +103,21 @@
 
         label.setWidth(50);
 
+        LinkedHashMap values = new LinkedHashMap();
+        values.put(FIELD_PLUGIN_WINFO, messages.winfo());
+        values.put(FIELD_PLUGIN_MINFO, messages.minfo());
+        values.put(FIELD_PLUGIN_MAP, messages.map());
+        values.put(FIELD_PLUGIN_FIX, messages.fix());
+
         radio.setShowTitle(false);
         radio.setVertical(false);
-        radio.setValueMap(
-            messages.winfo(),
-            messages.minfo(),
-            messages.map(),
-            messages.fix());
+        radio.setValueMap(values);
+
+        LinkedHashMap initial = new LinkedHashMap();
+        initial.put(FIELD_PLUGIN, FIELD_PLUGIN_WINFO);
 
         form.setFields(radio);
+        form.setValues(initial);
 
         layout.addMember(label);
         layout.addMember(form);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Thu Mar 17 09:29:10 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Thu Mar 17 09:54:05 2011 +0000
@@ -102,7 +102,7 @@
      */
     public Canvas create(Data data) {
         Canvas  widget = createWidget(data);
-        IButton submit = new IButton(MSG.next());
+        IButton submit = new IButton(MSG.next(), this);
         Label   label  = new Label(MSG.wqTitle());
 
         label.setHeight(25);

http://dive4elements.wald.intevation.org