changeset 798:7061c2e66039

Finished layouting the map components. flys-client/trunk@2317 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 11 Jul 2011 10:21:16 +0000
parents cc3f481e9484
children f4299b90c996
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java
diffstat 2 files changed, 48 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Jul 08 14:56:02 2011 +0000
+++ b/flys-client/ChangeLog	Mon Jul 11 10:21:16 2011 +0000
@@ -1,3 +1,9 @@
+2011-07-11  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java:
+	  Finished layouting the components. The map has the same layout as the
+	  chart now.
+
 2011-07-08  Ingo Weinzierl <ingo@intevation.de>
 
 	* pom.xml: Added a dependency to GwtOpenLayers 0.5 (Apache 2.0).
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Fri Jul 08 14:56:02 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Mon Jul 11 10:21:16 2011 +0000
@@ -1,14 +1,16 @@
 package de.intevation.flys.client.client.ui.map;
 
 import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
 
 import com.smartgwt.client.widgets.Button;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
+import com.smartgwt.client.widgets.events.ResizedEvent;
+import com.smartgwt.client.widgets.events.ResizedHandler;
 import com.smartgwt.client.widgets.layout.HLayout;
+import com.smartgwt.client.widgets.layout.VLayout;
 
 import org.gwtopenmaps.openlayers.client.Bounds;
 import org.gwtopenmaps.openlayers.client.LonLat;
@@ -52,30 +54,53 @@
 
 
     protected void initLayout() {
-        Canvas  wrapper = new Canvas();
-        wrapper.setWidth100();
-        wrapper.setHeight100();
-
-        VerticalPanel vlayout = new VerticalPanel();
-        vlayout.setWidth("100%");
+        VLayout rootLayout = new VLayout();
+        rootLayout.setHeight100();
+        rootLayout.setWidth100();
+        rootLayout.setMembersMargin(2);
 
         controlPanel = createControlPanel();
         themePanel   = createThemePanel();
         mapPanel     = floodMap.getMapWidget();
 
+        final Canvas  wrapper = new Canvas();
+        wrapper.setWidth100();
+        wrapper.setHeight100();
+
         final HorizontalPanel layout = new HorizontalPanel();
-        layout.setWidth("100%");
-        layout.setHeight("635px");
-
-        layout.add(themePanel);
+        layout.setWidth("99%");
+        layout.setHeight("99%");
         layout.add(mapPanel);
 
-        vlayout.add(controlPanel);
-        vlayout.add(layout);
+        wrapper.addChild(layout);
 
-        wrapper.addChild(vlayout);
+        HLayout hlayout = new HLayout();
+        hlayout.setHeight("*");
+        hlayout.setWidth100();
+        hlayout.setMembersMargin(2);
 
-        setPane(wrapper);
+        hlayout.addMember(themePanel);
+        hlayout.addMember(wrapper);
+
+        rootLayout.addMember(controlPanel);
+        rootLayout.addMember(hlayout);
+
+        wrapper.addResizedHandler(new ResizedHandler() {
+            public void onResized(ResizedEvent e) {
+                Integer height = wrapper.getHeight();
+                Integer width  = wrapper.getWidth();
+
+                height = height * 99 / 100;
+                width  = width  * 99 / 100;
+
+                String w = String.valueOf(width) + "px";
+                String h = String.valueOf(height) + "px";
+
+                floodMap.setSize(w, h);
+            }
+        });
+
+        setPane(rootLayout);
     }
 
 
@@ -104,7 +129,8 @@
         HLayout layout = new HLayout();
         layout.setWidth100();
         layout.setHeight(30);
-        layout.setMembersMargin(5);
+        layout.setMembersMargin(10);
+        layout.setPadding(5);
         layout.setBorder("1px solid black");
 
         Button zoomToMax = new Button("Max Extent");

http://dive4elements.wald.intevation.org