changeset 4064:61020a61ed38

Show river map only once.
author Christian Lins <christian.lins@intevation.de>
date Tue, 09 Oct 2012 11:02:50 +0200
parents 7c03d3bd9262
children 9d404069f361
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java
diffstat 6 files changed, 48 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Oct 08 12:22:03 2012 +0200
+++ b/flys-client/ChangeLog	Tue Oct 09 11:02:50 2012 +0200
@@ -1,3 +1,14 @@
+2012-10-09	Christian Lins	<christian.lins@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java,
+	  src/main/java/de/intevation/flys/client/client/ui/MapSelection.java:
+	  Show river map only once.
+
+	* src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java,
+	  src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java:
+	  Cosmetics.
+
 2012-10-08	Christian Lins	<christian.lins@intevation.de>
 
 	* ../.hgignore:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java	Mon Oct 08 12:22:03 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LinkSelection.java	Tue Oct 09 11:02:50 2012 +0200
@@ -8,19 +8,18 @@
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.form.DynamicForm;
 import com.smartgwt.client.widgets.form.fields.LinkItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
-import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
-import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
 
+import de.intevation.flys.client.client.FLYSConstants;
+import de.intevation.flys.client.client.event.StepForwardEvent;
 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.event.StepForwardEvent;
-
-import de.intevation.flys.client.client.FLYSConstants;
 
 
 /**
@@ -49,6 +48,7 @@
      *
      * @return a combobox.
      */
+    @Override
     public Canvas create(DataList data) {
         VLayout v = new VLayout();
         v.setMembersMargin(10);
@@ -64,6 +64,7 @@
     }
 
 
+    @Override
     public Canvas createOld(DataList dataList) {
         HLayout layout  = new HLayout();
         VLayout vLayout = new VLayout();
@@ -105,6 +106,7 @@
      *
      * @return a list of links
      */
+    @Override
     protected Canvas createWidget(DataList data) {
         GWT.log("LinkSelection - create()");
 
@@ -135,6 +137,7 @@
                 f.setItems(link);
                 formLayout.addMember(f);
                 link.addClickHandler(new ClickHandler() {
+                    @Override
                     public void onClick(ClickEvent event) {
                         DataItem item = new DefaultDataItem(
                             ((LinkItem)event.getItem()).getLinkTitle(),
@@ -166,6 +169,7 @@
     }
 
 
+    @Override
     protected Data[] getData() {
         Data[] module = super.getData();
         if (module != null) {
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java	Mon Oct 08 12:22:03 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java	Tue Oct 09 11:02:50 2012 +0200
@@ -4,12 +4,11 @@
 
 import com.smartgwt.client.types.VerticalAlignment;
 import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.Img;
 import com.smartgwt.client.widgets.layout.HLayout;
 
-import de.intevation.flys.client.shared.model.DataList;
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.shared.model.Data;
+import de.intevation.flys.client.shared.model.DataList;
 
 
 /**
@@ -21,6 +20,8 @@
  */
 public class MapSelection extends SelectProvider {
 
+    private static final long serialVersionUID = 1261822454641198692L;
+
     /** The interface that provides the image resources. */
     private FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
 
@@ -42,11 +43,10 @@
      *
      * @return a combobox.
      */
+    @Override
     protected Canvas createWidget(DataList data) {
         GWT.log("MapSelection - create()");
 
-        String baseUrl = GWT.getHostPageBaseURL();
-
         HLayout h = new HLayout();
         h.setAlign(VerticalAlignment.TOP);
         h.setHeight(100);
@@ -56,16 +56,14 @@
         form.setWidth(250);
         form.setLayoutAlign(VerticalAlignment.TOP);
 
-        Img map = new Img(baseUrl + MESSAGES.riverMap(), 400, 452);
-
-        // TODO implement event handling in the river map
+        // TODO implement event handling in the river map (here? or in LinkSelection)
 
         h.addMember(form);
-        helperContainer.addMember(map);
 
         return h;
     }
 
+    @Override
     protected Data[] getData() {
         if (moduleSelection != null) {
             return moduleSelection.getData();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Mon Oct 08 12:22:03 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapOutputTab.java	Tue Oct 09 11:02:50 2012 +0200
@@ -3,6 +3,7 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 import com.google.gwt.user.client.ui.Widget;
+
 import com.smartgwt.client.util.SC;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.events.ResizedEvent;
@@ -565,7 +566,7 @@
     public void toogleThemePanel() {
         this.themePanelCanvas.setVisible(!themePanelCanvas.isVisible());
         this.themePanelCanvas.setSize(themePanelCanvas.getWidthAsString(),
-                                      themePanelCanvas.getHeightAsString());
+                                       themePanelCanvas.getHeightAsString());
     }
 }
 // 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/map/MapPanel.java	Mon Oct 08 12:22:03 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapPanel.java	Tue Oct 09 11:02:50 2012 +0200
@@ -1,6 +1,7 @@
 package de.intevation.flys.client.client.ui.map;
 
 import com.google.gwt.user.client.ui.HorizontalPanel;
+
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.layout.VLayout;
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java	Mon Oct 08 12:22:03 2012 +0200
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/MapThemePanel.java	Tue Oct 09 11:02:50 2012 +0200
@@ -2,34 +2,33 @@
 
 import com.google.gwt.core.client.GWT;
 
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.util.BooleanCallback;
 import com.smartgwt.client.types.ImageStyle;
 import com.smartgwt.client.types.ListGridFieldType;
 import com.smartgwt.client.types.VerticalAlignment;
+import com.smartgwt.client.util.BooleanCallback;
+import com.smartgwt.client.util.SC;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Img;
 import com.smartgwt.client.widgets.grid.ListGrid;
 import com.smartgwt.client.widgets.grid.ListGridField;
 import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.HeaderDoubleClickEvent;
+import com.smartgwt.client.widgets.grid.events.HeaderDoubleClickHandler;
 import com.smartgwt.client.widgets.layout.HLayout;
 import com.smartgwt.client.widgets.layout.VLayout;
 import com.smartgwt.client.widgets.menu.Menu;
 import com.smartgwt.client.widgets.menu.MenuItem;
 import com.smartgwt.client.widgets.menu.events.ClickHandler;
 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent;
-import com.smartgwt.client.widgets.grid.events.HeaderDoubleClickHandler;
-import com.smartgwt.client.widgets.grid.events.HeaderDoubleClickEvent;
-
-import de.intevation.flys.client.shared.MapUtils;
-import de.intevation.flys.client.shared.model.AttributedTheme;
-import de.intevation.flys.client.shared.model.FacetRecord;
-import de.intevation.flys.client.shared.model.Theme;
-import de.intevation.flys.client.shared.model.OutputMode;
 
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.ui.CollectionView;
 import de.intevation.flys.client.client.ui.ThemePanel;
+import de.intevation.flys.client.shared.MapUtils;
+import de.intevation.flys.client.shared.model.AttributedTheme;
+import de.intevation.flys.client.shared.model.FacetRecord;
+import de.intevation.flys.client.shared.model.OutputMode;
+import de.intevation.flys.client.shared.model.Theme;
 
 
 /**
@@ -123,6 +122,7 @@
         list.setHeight100();
 
         list.addHeaderDoubleClickHandler(new HeaderDoubleClickHandler() {
+            @Override
             public void onHeaderDoubleClick(HeaderDoubleClickEvent event) {
                 // cancel the event.
                 return;
@@ -287,6 +287,15 @@
         return zoom;
     }
 
+    @Override
+    public String getWidthAsString() {
+        if(!isVisible()) {
+            return "0";
+        }
+        else {
+            return super.getWidthAsString();
+        }
+    }
 
     @Override
     public void activateTheme(Theme theme, boolean active) {

http://dive4elements.wald.intevation.org