changeset 58:d018995fbee7

The 'old' items in the parameter panel have a button to step back to a previous state (NOTE: just the UI stuff is implemented now). flys-client/trunk@1517 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 18 Mar 2011 12:01:55 +0000
parents 246af33f621c
children a3d235c63195
files flys-client/ChangeLog 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/ui/AbstractUIProvider.java flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java flys-client/src/main/webapp/images/back.png flys-client/src/main/webapp/images/back_de.png flys-client/src/main/webapp/images/back_en.png
diffstat 11 files changed, 62 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/ChangeLog	Fri Mar 18 12:01:55 2011 +0000
@@ -1,3 +1,25 @@
+2011-03-18  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 localized strings that point to the source of the 'back' button.
+
+	* src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java:
+	  Added a new method that creates the 'back' button and returns it.
+
+	  TODO: Fire an event that triggers the ADVANCE action.
+
+	* src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java:
+	  Append the 'back' button in the panel with the 'old' parameters.
+
+	* src/main/webapp/images/back.png,
+	  src/main/webapp/images/back_en.png,
+	  src/main/webapp/images/back_de.png: New. Images für the 'back' button in
+	  the parameterization.
+
 2011-03-18  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages.java	Fri Mar 18 12:01:55 2011 +0000
@@ -136,5 +136,8 @@
 
     @DefaultMessage("/images/next.png")
     String imageNext();
+
+    @DefaultMessage("/images/back.png")
+    String imageBack();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_de.properties	Fri Mar 18 12:01:55 2011 +0000
@@ -43,3 +43,4 @@
 unitQStep = m³/s
 
 imageNext = /images/next_de.png
+imageBack = /images/back_de.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSMessages_en.properties	Fri Mar 18 12:01:55 2011 +0000
@@ -43,3 +43,4 @@
 unitQStep = m³/s
 
 imageNext = /images/next_en.png
+imageBack = /images/back_en.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/AbstractUIProvider.java	Fri Mar 18 12:01:55 2011 +0000
@@ -81,6 +81,11 @@
     }
 
 
+    /**
+     * Creates the 'next' button to step forward to the next state.
+     *
+     * @return the 'next' button.
+     */
     protected Canvas getNextButton() {
         Img go = new Img(MSG.imageNext(), 80, 25);
         go.addClickHandler(this);
@@ -90,6 +95,27 @@
 
 
     /**
+     * Creates the 'back' button to step back to a previous state.
+     *
+     * @param targetState The identifier of the target state.
+     *
+     * @return the 'back' button.
+     */
+    protected Canvas getBackButton(final String targetState) {
+        Img back = new Img(MSG.imageBack(), 16, 16);
+
+        back.addClickHandler(new ClickHandler() {
+            public void onClick(ClickEvent event) {
+                GWT.log("Step back to: " + targetState);
+                GWT.log("TODO: fire StepBack event!");
+            }
+        });
+
+        return back;
+    }
+
+
+    /**
      * This method needs to be implemented by concrete subclasses. It should
      * create a new Canvas object with a representation of <i>data</i>.
      *
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/LocationDistancePanel.java	Fri Mar 18 12:01:55 2011 +0000
@@ -141,8 +141,11 @@
         sb.append(step[0].getLabel());
         sb.append(" " + MESSAGES.unitWidth());
 
+        Canvas back = getBackButton(dataList.getState());
+
         layout.addMember(label);
         layout.addMember(new Label(sb.toString()));
+        layout.addMember(back);
 
         return layout;
     }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/SelectProvider.java	Fri Mar 18 12:01:55 2011 +0000
@@ -82,8 +82,11 @@
             }
         }
 
+        Canvas back = getBackButton(dataList.getState());
+
         layout.addMember(label);
         layout.addMember(vLayout);
+        layout.addMember(back);
 
         return layout;
     }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Fri Mar 18 11:32:05 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WQInputPanel.java	Fri Mar 18 12:01:55 2011 +0000
@@ -157,8 +157,11 @@
             ? createWString(from[0], to[0], step[0])
             : createQString(from[0], to[0], step[0]);
 
+        Canvas back = getBackButton(dataList.getState());
+
         layout.addMember(label);
         layout.addMember(new Label(text));
+        layout.addMember(back);
 
         return layout;
     }
Binary file flys-client/src/main/webapp/images/back.png has changed
Binary file flys-client/src/main/webapp/images/back_de.png has changed
Binary file flys-client/src/main/webapp/images/back_en.png has changed

http://dive4elements.wald.intevation.org