changeset 39:4187a797fc3d

Implemented the step forward mechanism in the CollectionView and added the river map to the initial widget. flys-client/trunk@1472 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 15 Mar 2011 14:35:41 +0000
parents 7142386e86c2
children 1458bc0a20e2
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYSImages.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties flys-client/src/main/java/de/intevation/flys/client/client/images/gewkarte.png flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java
diffstat 8 files changed, 54 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Mar 14 18:09:21 2011 +0000
+++ b/flys-client/ChangeLog	Tue Mar 15 14:35:41 2011 +0000
@@ -1,3 +1,20 @@
+2011-03-15  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSMessages.java: Added
+	  a i18n string for a new calculation.
+
+	* src/main/java/de/intevation/flys/client/client/FLYSImages.java,
+	  src/main/java/de/intevation/flys/client/client/images/gewkarte.png: New
+	  image: the map that shows the relevant rivers.
+
+	* src/main/java/de/intevation/flys/client/client/ui/MapSelection.java:
+	  Added the river map to the right panel of that widget.
+
+	* src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
+	  Implemented the step forward mechanism.
+
 2011-03-14  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSImages.java	Mon Mar 14 18:09:21 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSImages.java	Tue Mar 15 14:35:41 2011 +0000
@@ -16,4 +16,7 @@
 
     @Source("images/flys_logo.gif")
     ImageResource logoFlys();
+
+    @Source("images/gewkarte.png")
+    ImageResource riverMap();
 }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java	Mon Mar 14 18:09:21 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java	Tue Mar 15 14:35:41 2011 +0000
@@ -47,6 +47,9 @@
     @DefaultMessage("New Project")
     String new_project();
 
+    @DefaultMessage("New Calculation")
+    String new_calculation();
+
     @DefaultMessage("Modul")
     String module_selection();
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties	Mon Mar 14 18:09:21 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties	Tue Mar 15 14:35:41 2011 +0000
@@ -11,6 +11,7 @@
 load_projects = Lade Berechnungen...
 date_format = dd.MM.yyyy
 new_project = Neues Projekt
+new_calculation = Neue Berechnung
 module_selection = Modul
 river_selection = Flüsse
 winfo = WINFO
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties	Mon Mar 14 18:09:21 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties	Tue Mar 15 14:35:41 2011 +0000
@@ -11,6 +11,7 @@
 load_projects = Load calculations...
 date_format = yyyy-MM-dd
 new_project = New Project
+new_calculation = New Calculation
 module_selection = Module
 river_selection = Rivers
 winfo = WINFO
Binary file flys-client/src/main/java/de/intevation/flys/client/client/images/gewkarte.png has changed
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Mon Mar 14 18:09:21 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Tue Mar 15 14:35:41 2011 +0000
@@ -126,8 +126,8 @@
      * This method handles the initial layout stuff.
      */
     protected void init() {
-        setWidth(600);
-        setHeight(400);
+        setWidth(700);
+        setHeight(600);
 
         layout.setWidth100();
 
@@ -143,7 +143,7 @@
         tabs.addTab(parameterTab);
 
         if (isNew()) {
-            tabs.setTabTitle(0, "MODUL");
+            tabs.setTabTitle(0, messages.new_calculation());
             tabs.updateTab(0, renderNew());
         }
     }
@@ -257,7 +257,7 @@
         }
 
         Data data = new DefaultData(
-            messages.river_selection(),
+            "river",
             messages.river_selection(),
             null,
             items,
@@ -363,6 +363,20 @@
     public void onStepForward(StepForwardEvent event) {
         GWT.log("CollectionView - onStepForward()");
         GWT.log("TODO: IMPLEMENT FEED!");
+        String serverUrl = Config.getInstance().getServerUrl();
+
+        forwardService.go(serverUrl, artifact, event.getData(),
+            new AsyncCallback<Artifact>() {
+                public void onFailure(Throwable caught) {
+                    GWT.log("Could not feed the artifact.");
+                    GWT.log(caught.getMessage());
+                }
+
+                public void onSuccess(Artifact artifact) {
+                    GWT.log("Successfully feed the artifact.");
+                    setArtifact(artifact);
+                }
+        });
     }
 
 
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java	Mon Mar 14 18:09:21 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java	Tue Mar 15 14:35:41 2011 +0000
@@ -1,13 +1,16 @@
 package de.intevation.flys.client.client.ui;
 
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.resources.client.ImageResource;
 
 import com.smartgwt.client.types.VerticalAlignment;
 import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.Img;
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.layout.HLayout;
 
 import de.intevation.flys.client.shared.model.Data;
+import de.intevation.flys.client.client.FLYSImages;
 
 
 /**
@@ -19,6 +22,10 @@
  */
 public class MapSelection extends SelectProvider {
 
+    /** The interface that provides the image resources. */
+    private FLYSImages IMAGES = GWT.create(FLYSImages.class);
+
+
     public MapSelection() {
     }
 
@@ -44,13 +51,13 @@
         Canvas form  = super.createWidget(data);
         form.setWidth(250);
 
-        Label  label = new Label("TODO: Map with rivers.");
-        label.setValign(VerticalAlignment.TOP);
+        ImageResource mapRes = IMAGES.riverMap();
+        Img map              = new Img(mapRes.getURL(), 400, 452);
 
-        // TODO add the map panel to select the rivers via map.
+        // TODO implement event handling in the river map
 
         h.addMember(form);
-        h.addMember(label);
+        h.addMember(map);
 
         return h;
     }

http://dive4elements.wald.intevation.org