Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ThemeNavigationPanel.java @ 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 | 902609b5cc79 |
children |
line wrap: on
line diff
--- 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) {