Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java @ 858:9f07f67f60a5
Subclassed ChartThemePanel, trigger redraws of Chart when interaction with
"Action" widgets in ThemePanel occured (but will still crash).
flys-client/trunk@2651 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 06 Sep 2011 11:09:13 +0000 |
parents | 2c48d75c4ab7 |
children | 6b047887855b |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Tue Sep 06 10:58:32 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java Tue Sep 06 11:09:13 2011 +0000 @@ -28,6 +28,7 @@ import de.intevation.flys.client.client.event.OutputParameterChangeHandler; import de.intevation.flys.client.client.event.PanEvent; import de.intevation.flys.client.client.event.PanHandler; +import de.intevation.flys.client.client.event.RedrawRequestHandler; import de.intevation.flys.client.client.event.ZoomEvent; import de.intevation.flys.client.client.event.ZoomHandler; import de.intevation.flys.client.client.services.ChartInfoService; @@ -44,7 +45,8 @@ implements ResizedHandler, OutputParameterChangeHandler, ZoomHandler, - PanHandler + PanHandler, + RedrawRequestHandler { public static final int DEFAULT_CHART_WIDTH = 600; public static final int DEFAULT_CHART_HEIGHT = 500; @@ -92,7 +94,7 @@ * @param title The title of this tab. * @param collection The Collection which this chart belongs to. * @param mode The OutputMode. - * @param collvetionView The shown collection. + * @param collectionView The shown collection. */ public ChartOutputTab( String title, @@ -125,9 +127,17 @@ hLayout.addMember(left); hLayout.addMember(right); - // TODO Spawn a specific ThemePanel subclass (e.g. "actions" column is - // not needed in all cases. - ChartThemePanel ctp = new ChartThemePanel(collection, mode); + // Output "cross_section" needs slightly modified ThemePanel + // (with action buttons). + ChartThemePanel ctp = null; + if (mode.getName().equals("cross_section")) { + ctp = new CrossSectionChartThemePanel(collection, mode); + } + else { + ctp = new ChartThemePanel(collection, mode); + } + + ctp.addChartShallRedrawHandler(this); ctp.addOutputParameterChangeHandler(this); chart = createChartImg(); @@ -158,6 +168,11 @@ } + public void onRedrawRequest() { + resetRanges(); + } + + /** * Listens to change event in the chart them panel and updates chart after * receiving such an event.