changeset 4160:bbc49d9450c8

Add a new panel to show settings of a gauge discharge curve
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 16 Oct 2012 16:10:38 +0200
parents bbae306fcb4f
children ff74ff82f2d4
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java
diffstat 3 files changed, 85 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Oct 16 15:51:27 2012 +0200
+++ b/flys-client/ChangeLog	Tue Oct 16 16:10:38 2012 +0200
@@ -1,3 +1,9 @@
+2012-10-16	Björn Ricks	<bjoern.ricks@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java,
+	  src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java:
+	  Add a new panel to show settings of a gauge discharge curve.
+
 2012-10-16	Björn Ricks	<bjoern.ricks@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/GaugeTree.java:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/GaugeDischargeCurvePanel.java	Tue Oct 16 16:10:38 2012 +0200
@@ -0,0 +1,76 @@
+package de.intevation.flys.client.client.ui;
+
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import com.google.gwt.core.client.GWT;
+
+import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
+
+import de.intevation.flys.client.shared.model.Data;
+import de.intevation.flys.client.shared.model.DataItem;
+import de.intevation.flys.client.shared.model.DataList;
+import de.intevation.flys.client.shared.model.DefaultData;
+import de.intevation.flys.client.shared.model.DefaultDataItem;
+
+import de.intevation.flys.client.client.FLYSConstants;
+
+
+/**
+ * This UIProvider displays the old DataItems of GaugeDischargeCurveArtifact
+ *
+ * @author <a href="mailto:bjoern.ricks@intevation.de">Björn Ricks</a>
+ */
+public class GaugeDischargeCurvePanel
+extends      AbstractUIProvider
+{
+    /** The message class that provides i18n strings.*/
+    protected FLYSConstants messages = GWT.create(FLYSConstants.class);
+
+    /** The combobox.*/
+    protected DynamicForm form;
+
+    @Override
+    public Canvas create(DataList data) {
+        VLayout layout   = new VLayout();
+        return layout;
+    }
+
+    @Override
+    public Canvas createOld(DataList dataList) {
+        HLayout layout  = new HLayout();
+        VLayout vLayout = new VLayout();
+        vLayout.setWidth("400px");
+
+        int size = dataList.size();
+        for (int i = 0; i < size; i++) {
+            Data data        = dataList.get(i);
+            DataItem[] items = data.getItems();
+
+            for (DataItem item: items) {
+                HLayout hLayout = new HLayout();
+
+                hLayout.addMember(new Label(item.getLabel()));
+                hLayout.addMember(new Label(item.getStringValue()));
+
+                vLayout.addMember(hLayout);
+                vLayout.setWidth("130px");
+            }
+        }
+
+        return vLayout;
+    }
+
+    @Override
+    protected Data[] getData() {
+        return null;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java	Tue Oct 16 15:51:27 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/UIProviderFactory.java	Tue Oct 16 16:10:38 2012 +0200
@@ -152,6 +152,9 @@
         else if (uiProvider.equals("minfo.bed.char_diameter")) {
             return new CheckboxPanel();
         }
+        else if (uiProvider.equals("gauge_discharge_curve")) {
+            return new GaugeDischargeCurvePanel();
+        }
         else {
             //GWT.log("Picked default provider.");
             return new SelectProvider();

http://dive4elements.wald.intevation.org