changeset 5030:5ae8b8b46323

Removed last gwt part from gauge info panel.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 20 Feb 2013 08:43:00 +0100
parents d1b50434b259
children 9c529b9de6b5
files flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java
diffstat 1 files changed, 35 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java	Wed Feb 20 08:45:55 2013 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/stationinfo/GaugeInfoPanel.java	Wed Feb 20 08:43:00 2013 +0100
@@ -5,7 +5,7 @@
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.i18n.client.NumberFormat;
 import com.google.gwt.user.client.ui.Anchor;
-import com.google.gwt.user.client.ui.Grid;
+import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
 import com.smartgwt.client.widgets.Label;
 
@@ -24,43 +24,64 @@
     public GaugeInfoPanel(GaugeInfo gauge, FLYS flys) {
         this.flys = flys;
         setStyleName("gaugeinfopanel");
-        setWidth100();
-
-        Grid grid = new Grid(5, 2);
 
         NumberFormat nf = NumberFormat.getDecimalFormat();
 
+        VLayout grid = new VLayout();
+        HLayout line1 = new HLayout();
+
         Double minw = gauge.getMinW();
         Double maxw = gauge.getMaxW();
         if (minw != null && maxw != null) {
-            grid.setText(0, 0, MSG.wq_value_q());
-            grid.setText(0, 1, nf.format(minw) +
-                    " - " + nf.format(maxw));
+            Label key = new Label(MSG.wq_value_q());
+            Label value = new Label(nf.format(minw) +
+                                    " - " + nf.format(maxw));
+            key.setWidth(150);
+            line1.addMember(key);
+            line1.addMember(value);
         }
 
+        HLayout line2 = new HLayout();
         Double minq = gauge.getMinQ();
         Double maxq = gauge.getMaxQ();
         if (minq != null && maxq != null) {
-            grid.setText(1, 0, MSG.wq_value_w());
-            grid.setText(1, 1, nf.format(minq) +
+            Label key = new Label(MSG.wq_value_w());
+            Label value = new Label( nf.format(minq) +
                     " - " + nf.format(maxq));
+            key.setWidth(150);
+            line2.addMember(key);
+            line2.addMember(value);
         }
 
+        HLayout line3 = new HLayout();
         Double aeo = gauge.getAeo();
         if (aeo != null) {
-            grid.setText(2, 0, "AEO [km²]");
-            grid.setText(2, 1, nf.format(aeo));
+            Label key = new Label("AEO [km²]");
+            Label value = new Label(nf.format(aeo));
+            key.setWidth(150);
+            line3.addMember(key);
+            line3.addMember(value);
         }
 
+        HLayout line4 = new HLayout();
         Double datum = gauge.getDatum();
         if (datum != null) {
-            grid.setText(3, 0, MSG.gauge_zero() + " [" +
+            Label key = new Label(MSG.gauge_zero() + " [" +
                     gauge.getWstUnit() + "]");
-            grid.setText(3, 1, nf.format(datum));
+            Label value = new Label(nf.format(datum));
+            key.setWidth(150);
+            line4.addMember(key);
+            line4.addMember(value);
         }
 
-        grid.setWidget(4,0, new GaugeMainValueAnchor(flys, gauge));
+        HLayout line5 = new HLayout();
+        line5.addMember(new GaugeMainValueAnchor(flys, gauge));
 
+        grid.addMember(line1);
+        grid.addMember(line2);
+        grid.addMember(line3);
+        grid.addMember(line4);
+        grid.addMember(line5);
         addMember(grid);
     }
 

http://dive4elements.wald.intevation.org