changeset 781:6653cf54b45d

The distance panel got two tables for locations and ranges. Both do not load any data until now. flys-client/trunk@2271 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 30 Jun 2011 11:59:02 +0000 (2011-06-30)
parents a39c2f531755
children 4a7ece57f44c
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/range/LocationsTable.java flys-client/src/main/java/de/intevation/flys/client/client/ui/range/RangeTable.java
diffstat 4 files changed, 181 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Jun 30 10:29:43 2011 +0000
+++ b/flys-client/ChangeLog	Thu Jun 30 11:59:02 2011 +0000
@@ -1,3 +1,13 @@
+2011-06-30  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/range/LocationsTable.java,
+	  src/main/java/de/intevation/flys/client/client/ui/range/RangeTable.java:
+	  New. These two tables are used to support the user to select from/to
+	  values in the distance panel.
+
+	* src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java:
+	  Added LocationsTable and RangeTable that currently load no data.
+
 2011-06-30  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java	Thu Jun 30 10:29:43 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DistancePanel.java	Thu Jun 30 11:59:02 2011 +0000
@@ -12,6 +12,8 @@
 import com.smartgwt.client.widgets.form.fields.events.BlurEvent;
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.tab.TabSet;
+import com.smartgwt.client.widgets.tab.Tab;
 
 import de.intevation.flys.client.shared.model.Data;
 import de.intevation.flys.client.shared.model.DataItem;
@@ -20,6 +22,8 @@
 import de.intevation.flys.client.shared.model.DefaultDataItem;
 
 import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.ui.range.RangeTable;
+import de.intevation.flys.client.client.ui.range.LocationsTable;
 
 
 public class DistancePanel extends AbstractUIProvider implements BlurHandler {
@@ -29,14 +33,21 @@
 
     protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
+    protected RangeTable     distancesTable;
+    protected LocationsTable locationsTable;
+
     protected DoubleRangePanel distancePanel;
 
+    protected TabSet tabs;
+
     protected double min;
     protected double max;
 
 
     public DistancePanel() {
-        distancePanel = new DoubleRangePanel(
+        distancesTable = new RangeTable();
+        locationsTable = new LocationsTable();
+        distancePanel  = new DoubleRangePanel(
             MSG.unitFrom(), MSG.unitTo(), MSG.unitWidth(),
             0d, 0d, 0d, 250, this);
     }
@@ -60,6 +71,7 @@
 
         initMinMaxValues(data);
         initDefaultValues(data);
+        initHelperPanel();
 
         return layout;
     }
@@ -281,5 +293,23 @@
 
         return Double.valueOf(defValue);
     }
+
+
+    protected void initHelperPanel() {
+        tabs = new TabSet();
+        tabs.setWidth100();
+        tabs.setHeight100();
+
+        Tab locations = new Tab(MSG.locations());
+        Tab distances = new Tab(MSG.distance());
+
+        locations.setPane(locationsTable);
+        distances.setPane(distancesTable);
+
+        tabs.addTab(locations, 0);
+        tabs.addTab(distances, 1);
+
+        helperContainer.addChild(tabs);
+    }
 }
 // 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/range/LocationsTable.java	Thu Jun 30 11:59:02 2011 +0000
@@ -0,0 +1,70 @@
+package de.intevation.flys.client.client.ui.range;
+
+import com.google.gwt.core.client.GWT;
+
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+
+import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.FLYSImages;
+
+
+/**
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class LocationsTable extends ListGrid {
+
+    /** The message class that provides i18n strings.*/
+    protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
+
+    /** The interface that provides the image resources. */
+    private FLYSImages IMAGES = GWT.create(FLYSImages.class);
+
+
+    public LocationsTable() {
+        setWidth100();
+        setHeight100();
+        setSelectionType(SelectionStyle.SINGLE);
+        setSelectionType(SelectionStyle.SINGLE);
+        setShowHeaderContextMenu(false);
+        setShowRecordComponents(true);
+        setShowRecordComponentsByCell(true);
+        setEmptyMessage(MSG.empty_table());
+
+        ListGridField addfrom = new ListGridField ("", "");
+        addfrom.setType(ListGridFieldType.ICON);
+        addfrom.setWidth(20);
+        addfrom.setCellIcon(IMAGES.markerGreen().getURL());
+
+        ListGridField addto = new ListGridField("", "");
+        addto.setType(ListGridFieldType.ICON);
+        addto.setWidth(20);
+        addto.setCellIcon(IMAGES.markerRed().getURL());
+
+        ListGridField ldescr = new ListGridField(
+            "description", MSG.description());
+        ldescr.setType(ListGridFieldType.TEXT);
+        ldescr.setWidth("*");
+
+        ListGridField lside = new ListGridField("riverside", MSG.riverside());
+        lside.setType(ListGridFieldType.TEXT);
+        lside.setWidth(40);
+
+        ListGridField loc = new ListGridField("from", MSG.locations());
+        loc.setType(ListGridFieldType.TEXT);
+        loc.setWidth(40);
+
+        ListGridField bottom = new ListGridField("bottom", MSG.bottom_edge());
+        bottom.setType(ListGridFieldType.TEXT);
+        bottom.setWidth(30);
+
+        ListGridField top = new ListGridField("top", MSG.top_edge());
+        top.setType(ListGridFieldType.TEXT);
+        top.setWidth(30);
+
+        setFields(addfrom, addto, ldescr, loc, lside, bottom, top);
+    }
+}
+// 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/range/RangeTable.java	Thu Jun 30 11:59:02 2011 +0000
@@ -0,0 +1,70 @@
+package de.intevation.flys.client.client.ui.range;
+
+import com.google.gwt.core.client.GWT;
+
+import com.smartgwt.client.types.ListGridFieldType;
+import com.smartgwt.client.types.SelectionStyle;
+import com.smartgwt.client.widgets.grid.ListGrid;
+import com.smartgwt.client.widgets.grid.ListGridField;
+
+import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.FLYSImages;
+
+
+/**
+ * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
+ */
+public class RangeTable extends ListGrid {
+
+    /** The message class that provides i18n strings.*/
+    protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
+
+    /** The interface that provides the image resources. */
+    private FLYSImages IMAGES = GWT.create(FLYSImages.class);
+
+
+    public RangeTable() {
+        setWidth100();
+        setHeight100();
+        setSelectionType(SelectionStyle.SINGLE);
+        setSelectionType(SelectionStyle.SINGLE);
+        setShowHeaderContextMenu(false);
+        setShowRecordComponents(true);
+        setShowRecordComponentsByCell(true);
+        setEmptyMessage(MESSAGES.empty_table());
+
+        ListGridField addDistance = new ListGridField ("", "");
+        addDistance.setType (ListGridFieldType.ICON);
+        addDistance.setWidth (20);
+        addDistance.setCellIcon (IMAGES.markerGreen ().getURL ());
+
+        ListGridField ddescr = new ListGridField(
+            "description", MESSAGES.description());
+        ddescr.setType(ListGridFieldType.TEXT);
+        ddescr.setWidth("*");
+        ListGridField from = new ListGridField("from", MESSAGES.from());
+        from.setType(ListGridFieldType.TEXT);
+        from.setWidth(40);
+
+        ListGridField to = new ListGridField("to", MESSAGES.to());
+        to.setType(ListGridFieldType.TEXT);
+        to.setWidth(40);
+
+        ListGridField dside = new ListGridField(
+            "riverside", MESSAGES.riverside());
+        dside.setType(ListGridFieldType.TEXT);
+        dside.setWidth(40);
+
+        ListGridField bottom = new ListGridField(
+            "bottom", MESSAGES.bottom_edge());
+        bottom.setType(ListGridFieldType.TEXT);
+        bottom.setWidth(30);
+
+        ListGridField top = new ListGridField("top", MESSAGES.top_edge());
+        top.setType(ListGridFieldType.TEXT);
+        top.setWidth(30);
+
+        setFields(addDistance, ddescr, from, to, dside, bottom, top);
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org