# HG changeset patch # User Ingo Weinzierl # Date 1300199741 0 # Node ID 4187a797fc3d2b89920a068e1697d0b929c9d28d # Parent 7142386e86c2fe5bdb6ba9127407b70a20d8c659 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 diff -r 7142386e86c2 -r 4187a797fc3d flys-client/ChangeLog --- 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 + + * 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 * src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java, diff -r 7142386e86c2 -r 4187a797fc3d flys-client/src/main/java/de/intevation/flys/client/client/FLYSImages.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(); } diff -r 7142386e86c2 -r 4187a797fc3d flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java --- 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(); diff -r 7142386e86c2 -r 4187a797fc3d flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties --- 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 diff -r 7142386e86c2 -r 4187a797fc3d flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties --- 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 diff -r 7142386e86c2 -r 4187a797fc3d flys-client/src/main/java/de/intevation/flys/client/client/images/gewkarte.png Binary file flys-client/src/main/java/de/intevation/flys/client/client/images/gewkarte.png has changed diff -r 7142386e86c2 -r 4187a797fc3d flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java --- 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() { + 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); + } + }); } diff -r 7142386e86c2 -r 4187a797fc3d flys-client/src/main/java/de/intevation/flys/client/client/ui/MapSelection.java --- 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; }