Mercurial > dive4elements > river
changeset 1540:cd88a257a5e6
Minor refactoring.
flys-client/trunk@3759 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 25 Jan 2012 08:29:52 +0000 |
parents | 28e514c968d6 |
children | 959e1d0df941 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java |
diffstat | 2 files changed, 28 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Tue Jan 24 14:58:48 2012 +0000 +++ b/flys-client/ChangeLog Wed Jan 25 08:29:52 2012 +0000 @@ -1,3 +1,9 @@ +2012-01-25 Felix Wolfsteller <felix.wolfsteller@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java: + (adjustImageButton): Extracted/Refactored. Laid minimal groundstep + for adding points ui. + 2012-01-24 Raimund Renkert <raimund.renkert@intevation.de> * src/main/java/de/intevation/flys/client/client/ui/CollectionView.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Tue Jan 24 14:58:48 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Wed Jan 25 08:29:52 2012 +0000 @@ -16,19 +16,19 @@ /** + * Toolbar with buttons/icons to open datacage, switch to zoom mode, zoom out + * etc. + * * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class ChartToolbar extends Toolbar { protected static FLYSConstants MSG = GWT.create(FLYSConstants.class); - public static final int PANEL_HEIGHT = 30; - protected ChartOutputTab chartTab; - protected Button datacage; protected Canvas downloadPNG; @@ -49,10 +49,11 @@ protected ImgButton chartProperties; + protected ImgButton addPoints; + protected PanControl panControl; - public ChartToolbar(CollectionView view, ChartOutputTab chartTab) { super(chartTab); @@ -65,6 +66,7 @@ historyBack = new ImgButton(); panControl = new PanControl(chartTab, MSG.pan()); chartProperties = new ImgButton(); + addPoints = new ImgButton(); datacage.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { @@ -94,14 +96,7 @@ 20); zoomToMaxExtent.setSrc(baseUrl + MSG.zoom_all()); - zoomToMaxExtent.setWidth(20); - zoomToMaxExtent.setHeight(20); - zoomToMaxExtent.setShowDown(false); - zoomToMaxExtent.setShowRollOver(false); - zoomToMaxExtent.setShowDisabled(false); - zoomToMaxExtent.setShowDisabledIcon(true); - zoomToMaxExtent.setShowDownIcon(false); - zoomToMaxExtent.setShowFocusedIcon(false); + adjustImageButton(zoomToMaxExtent); zoomToMaxExtent.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { getChartOutputTab().resetRanges(); @@ -109,14 +104,7 @@ }); zoomOut.setSrc(baseUrl + MSG.zoom_out()); - zoomOut.setWidth(20); - zoomOut.setHeight(20); - zoomOut.setShowDown(false); - zoomOut.setShowRollOver(false); - zoomOut.setShowDisabled(false); - zoomOut.setShowDisabledIcon(true); - zoomOut.setShowDownIcon(false); - zoomOut.setShowFocusedIcon(false); + adjustImageButton(zoomOut); zoomOut.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { getChartOutputTab().zoomOut(10); @@ -124,14 +112,7 @@ }); historyBack.setSrc(baseUrl + MSG.zoom_back()); - historyBack.setWidth(20); - historyBack.setHeight(20); - historyBack.setShowDown(false); - historyBack.setShowRollOver(false); - historyBack.setShowDisabled(false); - historyBack.setShowDisabledIcon(true); - historyBack.setShowDownIcon(false); - historyBack.setShowFocusedIcon(false); + adjustImageButton(historyBack); historyBack.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { getChartOutputTab().zoomOut(); @@ -153,14 +134,7 @@ }); chartProperties.setSrc(baseUrl + MSG.properties_ico()); - chartProperties.setWidth(20); - chartProperties.setHeight(20); - chartProperties.setShowDown(false); - chartProperties.setShowRollOver(false); - chartProperties.setShowDisabled(false); - chartProperties.setShowDisabledIcon(true); - chartProperties.setShowDownIcon(false); - chartProperties.setShowFocusedIcon(false); + adjustImageButton(chartProperties); chartProperties.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { openPropertiesEditor(); @@ -170,6 +144,18 @@ initLayout(); } + /** Set width, height and other properties of an imagebutton. */ + public void adjustImageButton(ImageButton imgButton) { + imgButton.setWidth(20); + imgButton.setHeight(20); + imgButton.setShowDown(false); + imgButton.setShowRollOver(false); + imgButton.setShowDisabled(false); + imgButton.setShowDisabledIcon(true); + imgButton.setShowDownIcon(false); + imgButton.setShowFocusedIcon(false); + } + public ChartOutputTab getChartOutputTab() { return chartTab;