Mercurial > dive4elements > river
changeset 541:ed29599e06e5
Added the ChartOutputTab as ZoomHandler for the ZoomboxControl - no zooming is done yet.
flys-client/trunk@2041 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 01 Jun 2011 14:13:29 +0000 (2011-06-01) |
parents | a866cdf1ca40 |
children | 7c57149e8715 |
files | flys-client/ChangeLog 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/ChartToolbar.java flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ZoomboxControl.java |
diffstat | 4 files changed, 40 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Wed Jun 01 13:43:35 2011 +0000 +++ b/flys-client/ChangeLog Wed Jun 01 14:13:29 2011 +0000 @@ -1,3 +1,17 @@ +2011-06-01 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java: + Implements the ZoomHandler interface now. Currently, the values are just + received from ZoomboxControl. We still need to refresh the chart with + those zoom values. + + * src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java: + Registered the ChartOutputTab as ZoomHandler at the ZoomboxControl. + + * src/main/java/de/intevation/flys/client/client/ui/chart/ZoomboxControl.java: + Bugfix: fire the ZoomEvent when mouse up events occur. The events was + not fired anytime. + 2011-06-01 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/client/event/HasZoomHandlers.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Wed Jun 01 13:43:35 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Wed Jun 01 14:13:29 2011 +0000 @@ -20,6 +20,8 @@ import de.intevation.flys.client.client.Config; import de.intevation.flys.client.client.event.OutputParameterChangeEvent; import de.intevation.flys.client.client.event.OutputParameterChangeHandler; +import de.intevation.flys.client.client.event.ZoomEvent; +import de.intevation.flys.client.client.event.ZoomHandler; import de.intevation.flys.client.client.services.ChartInfoService; import de.intevation.flys.client.client.services.ChartInfoServiceAsync; import de.intevation.flys.client.client.ui.CollectionView; @@ -31,7 +33,7 @@ */ public class ChartOutputTab extends OutputTab -implements ResizedHandler, OutputParameterChangeHandler +implements ResizedHandler, OutputParameterChangeHandler, ZoomHandler { public static final int DEFAULT_CHART_WIDTH = 600; public static final int DEFAULT_CHART_HEIGHT = 500; @@ -135,6 +137,24 @@ /** + * Listens to zoom events and refreshes the current chart in such case. + * + * @param evt The ZoomEvent that stores the coordinates for zooming. + */ + public void onZoom(ZoomEvent evt) { + double[] lower = transformer.transform(evt.getStartX(), evt.getStartY()); + double[] upper = transformer.transform(evt.getEndX(), evt.getEndY()); + + double xmin = lower[0]; + double xmax = upper[0]; + double ymin = upper[1]; + double ymax = lower[1]; + + // TODO Trigger the recreation of the chart + } + + + /** * Updates the Transform2D object using the chart info service. */ public void updateTransformer() {
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Wed Jun 01 13:43:35 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java Wed Jun 01 14:13:29 2011 +0000 @@ -58,6 +58,8 @@ } }); + zoombox.addZoomHandler(chartTab); + initLayout(); }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ZoomboxControl.java Wed Jun 01 13:43:35 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ZoomboxControl.java Wed Jun 01 14:13:29 2011 +0000 @@ -71,7 +71,7 @@ */ protected void initZoombox() { zoombox.setPosition(Positioning.ABSOLUTE); - zoombox.setBackgroundColor("red"); + zoombox.setBorder("2px solid black"); zoombox.setOpacity(50); zoombox.setWidth(0); zoombox.setHeight(0); @@ -149,6 +149,8 @@ end[0] = getRelativeX(event.getX()); end[1] = getRelativeY(event.getY()); + fireZoomEvent(); + clearZoombox(); chartTab.getChartPanel().removeChild(zoombox);