Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
857:fa8efe5b8aee | 858:9f07f67f60a5 |
---|---|
26 import de.intevation.flys.client.client.Config; | 26 import de.intevation.flys.client.client.Config; |
27 import de.intevation.flys.client.client.event.OutputParameterChangeEvent; | 27 import de.intevation.flys.client.client.event.OutputParameterChangeEvent; |
28 import de.intevation.flys.client.client.event.OutputParameterChangeHandler; | 28 import de.intevation.flys.client.client.event.OutputParameterChangeHandler; |
29 import de.intevation.flys.client.client.event.PanEvent; | 29 import de.intevation.flys.client.client.event.PanEvent; |
30 import de.intevation.flys.client.client.event.PanHandler; | 30 import de.intevation.flys.client.client.event.PanHandler; |
31 import de.intevation.flys.client.client.event.RedrawRequestHandler; | |
31 import de.intevation.flys.client.client.event.ZoomEvent; | 32 import de.intevation.flys.client.client.event.ZoomEvent; |
32 import de.intevation.flys.client.client.event.ZoomHandler; | 33 import de.intevation.flys.client.client.event.ZoomHandler; |
33 import de.intevation.flys.client.client.services.ChartInfoService; | 34 import de.intevation.flys.client.client.services.ChartInfoService; |
34 import de.intevation.flys.client.client.services.ChartInfoServiceAsync; | 35 import de.intevation.flys.client.client.services.ChartInfoServiceAsync; |
35 import de.intevation.flys.client.client.ui.CollectionView; | 36 import de.intevation.flys.client.client.ui.CollectionView; |
42 public class ChartOutputTab | 43 public class ChartOutputTab |
43 extends OutputTab | 44 extends OutputTab |
44 implements ResizedHandler, | 45 implements ResizedHandler, |
45 OutputParameterChangeHandler, | 46 OutputParameterChangeHandler, |
46 ZoomHandler, | 47 ZoomHandler, |
47 PanHandler | 48 PanHandler, |
49 RedrawRequestHandler | |
48 { | 50 { |
49 public static final int DEFAULT_CHART_WIDTH = 600; | 51 public static final int DEFAULT_CHART_WIDTH = 600; |
50 public static final int DEFAULT_CHART_HEIGHT = 500; | 52 public static final int DEFAULT_CHART_HEIGHT = 500; |
51 | 53 |
52 public static final int THEMEPANEL_MIN_WIDTH = 200; | 54 public static final int THEMEPANEL_MIN_WIDTH = 200; |
90 * The default constructor to create a new ChartOutputTab. | 92 * The default constructor to create a new ChartOutputTab. |
91 * | 93 * |
92 * @param title The title of this tab. | 94 * @param title The title of this tab. |
93 * @param collection The Collection which this chart belongs to. | 95 * @param collection The Collection which this chart belongs to. |
94 * @param mode The OutputMode. | 96 * @param mode The OutputMode. |
95 * @param collvetionView The shown collection. | 97 * @param collectionView The shown collection. |
96 */ | 98 */ |
97 public ChartOutputTab( | 99 public ChartOutputTab( |
98 String title, | 100 String title, |
99 Collection collection, | 101 Collection collection, |
100 OutputMode mode, | 102 OutputMode mode, |
123 hLayout.setMembersMargin(10); | 125 hLayout.setMembersMargin(10); |
124 | 126 |
125 hLayout.addMember(left); | 127 hLayout.addMember(left); |
126 hLayout.addMember(right); | 128 hLayout.addMember(right); |
127 | 129 |
128 // TODO Spawn a specific ThemePanel subclass (e.g. "actions" column is | 130 // Output "cross_section" needs slightly modified ThemePanel |
129 // not needed in all cases. | 131 // (with action buttons). |
130 ChartThemePanel ctp = new ChartThemePanel(collection, mode); | 132 ChartThemePanel ctp = null; |
133 if (mode.getName().equals("cross_section")) { | |
134 ctp = new CrossSectionChartThemePanel(collection, mode); | |
135 } | |
136 else { | |
137 ctp = new ChartThemePanel(collection, mode); | |
138 } | |
139 | |
140 ctp.addChartShallRedrawHandler(this); | |
131 ctp.addOutputParameterChangeHandler(this); | 141 ctp.addOutputParameterChangeHandler(this); |
132 | 142 |
133 chart = createChartImg(); | 143 chart = createChartImg(); |
134 right.addChild(chart); | 144 right.addChild(chart); |
135 right.setOverflow(Overflow.HIDDEN); | 145 right.setOverflow(Overflow.HIDDEN); |
153 * @param event The resize event. | 163 * @param event The resize event. |
154 */ | 164 */ |
155 public void onResized(ResizedEvent event) { | 165 public void onResized(ResizedEvent event) { |
156 updateChartPanel(); | 166 updateChartPanel(); |
157 updateChartInfo(); | 167 updateChartInfo(); |
168 } | |
169 | |
170 | |
171 public void onRedrawRequest() { | |
172 resetRanges(); | |
158 } | 173 } |
159 | 174 |
160 | 175 |
161 /** | 176 /** |
162 * Listens to change event in the chart them panel and updates chart after | 177 * Listens to change event in the chart them panel and updates chart after |