changeset 532:0ba7c43e7b62

Replaced buttons displayed as labels with real buttons. flys-client/trunk@2023 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 27 May 2011 13:10:09 +0000
parents c17c593f8732
children 34103ab9fe60
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/MainMenu.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ThemeNavigationPanel.java flys-client/src/main/webapp/images/theme_bottom.png flys-client/src/main/webapp/images/theme_down.png flys-client/src/main/webapp/images/theme_top.png flys-client/src/main/webapp/images/theme_up.png
diffstat 12 files changed, 90 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/ChangeLog	Fri May 27 13:10:09 2011 +0000
@@ -1,3 +1,26 @@
+2011-05-27  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/MainMenu.java:
+	  Replaced buttons displayed as labels with real buttons.
+
+	* src/main/java/de/intevation/flys/client/client/ui/MainMenu.java,
+	  src/main/java/de/intevation/flys/client/client/ui/chart/ThemeNavigationPanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java:
+	  Replaced label buttons with real buttons.
+
+	* src/main/webapp/images/theme_top.png,
+	  src/main/webapp/images/theme_up.png,
+	  src/main/webapp/images/theme_bottom.png,
+	  src/main/webapp/images/theme_down.png: New. Images used in the
+	  ThemeNavigationPanel for buttons to move themes.
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.java: Added
+	  i18n string for the databasket and pathes for the icons used in the
+	  ThemeNavigationPanel.
+
 2011-05-27  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/event/HasOutputParameterChangeHandlers.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri May 27 13:10:09 2011 +0000
@@ -60,6 +60,16 @@
 
     String chart();
 
+    String databasket();
+
+    String theme_top();
+
+    String theme_up();
+
+    String theme_down();
+
+    String theme_bottom();
+
     String fix();
 
     String next();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri May 27 13:10:09 2011 +0000
@@ -24,6 +24,7 @@
 minfo = MINFO
 map = New Map
 chart = New Chart
+databasket = Databasket
 fix = TODO FIX ANALYSE TODO
 next = Next
 location_distance_state = Choose calculation location/range
@@ -66,6 +67,10 @@
 buttonNext = Next
 imageBack = images/back_en.png
 imageSave = images/save.gif
+theme_top = images/theme_top.png
+theme_up = images/theme_up.png
+theme_down = images/theme_down.png
+theme_bottom = images/theme_bottom.png
 
 discharge_curve = Discharge Curves at Gauges
 computed_discharge_curve = Discharge Curve
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri May 27 13:10:09 2011 +0000
@@ -24,6 +24,7 @@
 minfo = MINFO
 map = Neue Karte
 chart = Neues Diagramm
+databasket = Datenkorb
 fix = Fixierungsanalyse
 next = Weiter
 location_distance_state = Berechnungsort/strecke wählen
@@ -66,6 +67,10 @@
 buttonNext = Übernehmen
 imageBack = images/back_de.png
 imageSave = images/save.gif
+theme_top = images/theme_top.png
+theme_up = images/theme_up.png
+theme_down = images/theme_down.png
+theme_bottom = images/theme_bottom.png
 
 discharge_curve = Abflusskurven an Pegeln
 computed_discharge_curve = Abflusskurve
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri May 27 13:10:09 2011 +0000
@@ -24,6 +24,7 @@
 minfo = MINFO
 map = New Map
 chart = New Chart
+databasket = Databasket
 fix = TODO FIX ANALYSE TODO
 next = Next
 location_distance_state = Choose calculation location/range
@@ -66,6 +67,10 @@
 buttonNext = Next
 imageBack = images/back_en.png
 imageSave = images/save.gif
+theme_top = images/theme_top.png
+theme_up = images/theme_up.png
+theme_down = images/theme_down.png
+theme_bottom = images/theme_bottom.png
 
 discharge_curve = Discharge Curves at Gauges
 computed_discharge_curve = Discharge Curve
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/MainMenu.java	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/MainMenu.java	Fri May 27 13:10:09 2011 +0000
@@ -7,6 +7,7 @@
 import com.smartgwt.client.types.Alignment;
 import com.smartgwt.client.util.BooleanCallback;
 import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.Button;
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
@@ -35,19 +36,19 @@
     protected Label userText;
 
     /** The button to log the current user out.*/
-    protected Label logout;
+    protected Button logout;
 
     /** The button to add new projects.*/
-    protected Label newProject;
+    protected Button newProject;
 
     /** The button to open the project list.*/
-    protected Label projectList;
+    protected Button projectList;
 
     /** The button to switch between the english and german version.*/
-    protected Label language;
+    protected Button language;
 
     /** The button to open an info panel.*/
-    protected Label info;
+    protected Button info;
 
     /**
      * The default constructor for creating a new MainMenu.
@@ -58,11 +59,11 @@
         String guest = messages.user() + " " + messages.guest();
 
         userText    = new Label(guest);
-        newProject  = new Label(messages.new_project());
-        projectList = new Label(messages.manage_projects());
-        logout      = new Label(messages.logout());
-        language    = new Label(messages.switch_language());
-        info        = new Label(messages.info());
+        newProject  = new Button(messages.new_project());
+        projectList = new Button(messages.manage_projects());
+        logout      = new Button(messages.logout());
+        language    = new Button(messages.switch_language());
+        info        = new Button(messages.info());
 
         newProject.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
@@ -146,10 +147,6 @@
         leftPanel.addMember(projectList);
 
         userText.setAlign(Alignment.RIGHT);
-        logout.setAlign(Alignment.RIGHT);
-        info.setAlign(Alignment.RIGHT);
-        language.setAlign(Alignment.RIGHT);
-
         userText.setWidth(200);
         logout.setWidth(70);
         info.setWidth(40);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java	Fri May 27 13:10:09 2011 +0000
@@ -4,8 +4,7 @@
 
 import com.google.gwt.core.client.GWT;
 
-import com.smartgwt.client.types.Alignment;
-
+import com.smartgwt.client.widgets.Button;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Img;
 import com.smartgwt.client.widgets.Label;
@@ -24,6 +23,7 @@
 import de.intevation.flys.client.shared.model.Collection;
 import de.intevation.flys.client.shared.model.OutputMode;
 import de.intevation.flys.client.client.Config;
+import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.event.OutputParameterChangeEvent;
 import de.intevation.flys.client.client.event.OutputParameterChangeHandler;
 import de.intevation.flys.client.client.ui.CollectionView;
@@ -44,6 +44,9 @@
     public static final int THEMEPANEL_MIN_WIDTH = 200;
 
 
+    protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
+
+
     /** The canvas that wraps the chart toolbar.*/
     protected Canvas tbarPanel;
 
@@ -148,11 +151,8 @@
         hLayout.setHeight100();
         hLayout.setMembersMargin(10);
 
-        Label datacage = new Label("Datenkorb");
+        Button datacage = new Button(MSG.databasket());
         datacage.setHeight(20);
-        datacage.setBackgroundColor("#BED730");
-        datacage.setBorder("1px solid black");
-        datacage.setAlign(Alignment.CENTER);
 
         hLayout.setMargin(5);
         hLayout.addMember(datacage);
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ThemeNavigationPanel.java	Fri May 27 09:50:57 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ThemeNavigationPanel.java	Fri May 27 13:10:09 2011 +0000
@@ -5,13 +5,13 @@
 
 import com.google.gwt.core.client.GWT;
 
-import com.smartgwt.client.types.Alignment;
-import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.ImgButton;
 import com.smartgwt.client.widgets.events.ClickEvent;
 import com.smartgwt.client.widgets.events.ClickHandler;
 import com.smartgwt.client.widgets.layout.HLayout;
 
+import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.event.OnMoveEvent;
 import de.intevation.flys.client.client.event.OnMoveHandler;
 
@@ -22,10 +22,13 @@
 public class ThemeNavigationPanel extends Canvas {
 
     public static final int PANEL_MARGIN  = 5;
-    public static final int BUTTON_HEIGHT = 20;
+    public static final int BUTTON_HEIGHT = 25;
     public static final int BUTTON_MARGIN = 5;
 
 
+    protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
+
+
     protected List<OnMoveHandler> handlers;
 
 
@@ -41,10 +44,10 @@
         layout.setHeight(BUTTON_HEIGHT);
         layout.setMembersMargin(BUTTON_MARGIN);
 
-        Canvas cu = createButton("CU", OnMoveEvent.TOP);
-        Canvas u  = createButton("U", OnMoveEvent.UP);
-        Canvas d  = createButton("D", OnMoveEvent.DOWN);
-        Canvas cd = createButton("CD", OnMoveEvent.BOTTOM);
+        Canvas cu = createButton(MSG.theme_top(), OnMoveEvent.TOP);
+        Canvas u  = createButton(MSG.theme_up(), OnMoveEvent.UP);
+        Canvas d  = createButton(MSG.theme_down(), OnMoveEvent.DOWN);
+        Canvas cd = createButton(MSG.theme_bottom(), OnMoveEvent.BOTTOM);
 
         layout.addMember(cu);
         layout.addMember(u);
@@ -55,13 +58,22 @@
     }
 
 
-    protected Canvas createButton(final String type, final int moveType) {
-        Label b = new Label(type);
-        b.setBackgroundColor("#BED730");
-        b.setBorder("1px solid black");
+    protected Canvas createButton(final String title, final int moveType) {
+        String url = GWT.getHostPageBaseURL() + title;
+
+        ImgButton b = new ImgButton();
+        b.setSrc(url);
+        b.setHeight(BUTTON_HEIGHT);
         b.setWidth(40);
-        b.setHeight(BUTTON_HEIGHT);
-        b.setAlign(Alignment.CENTER);
+        b.setIconHeight(BUTTON_HEIGHT-10);
+        b.setShowDown(false);
+        b.setShowRollOver(false);
+        b.setShowDisabled(false);
+        b.setShowDisabledIcon(true);
+        b.setShowDownIcon(false);
+        b.setShowFocusedIcon(false);
+        b.setBackgroundColor("f2f2f2");
+        b.setBorder("1px solid #A6ABB4");
 
         b.addClickHandler(new ClickHandler() {
             public void onClick(ClickEvent event) {
Binary file flys-client/src/main/webapp/images/theme_bottom.png has changed
Binary file flys-client/src/main/webapp/images/theme_down.png has changed
Binary file flys-client/src/main/webapp/images/theme_top.png has changed
Binary file flys-client/src/main/webapp/images/theme_up.png has changed

http://dive4elements.wald.intevation.org