comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartOutputTab.java @ 3370:08b2472111aa

New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server. flys-client/trunk@5078 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 20 Jul 2012 07:40:55 +0000
parents 6d749af6a9c2
children b6575b8c8db0
comparison
equal deleted inserted replaced
3369:20688790f0c0 3370:08b2472111aa
1 package de.intevation.flys.client.client.ui.chart; 1 package de.intevation.flys.client.client.ui.chart;
2 2
3 import com.google.gwt.core.client.GWT; 3 import com.google.gwt.core.client.GWT;
4 import com.google.gwt.user.client.rpc.AsyncCallback; 4 import com.google.gwt.user.client.rpc.AsyncCallback;
5 import com.smartgwt.client.types.Overflow; 5 import com.smartgwt.client.types.Overflow;
6 import com.smartgwt.client.types.Visibility;
6 import com.smartgwt.client.widgets.Canvas; 7 import com.smartgwt.client.widgets.Canvas;
7 import com.smartgwt.client.widgets.Img; 8 import com.smartgwt.client.widgets.Img;
8 import com.smartgwt.client.widgets.events.ResizedEvent; 9 import com.smartgwt.client.widgets.events.ResizedEvent;
9 import com.smartgwt.client.widgets.events.ResizedHandler; 10 import com.smartgwt.client.widgets.events.ResizedHandler;
10 import com.smartgwt.client.widgets.layout.HLayout; 11 import com.smartgwt.client.widgets.layout.HLayout;
132 hLayout.setMembersMargin(10); 133 hLayout.setMembersMargin(10);
133 134
134 hLayout.addMember(left); 135 hLayout.addMember(left);
135 hLayout.addMember(right); 136 hLayout.addMember(right);
136 137
138 ctp = createThemePanel(mode, collectionView);
139 if (ctp != null) {
140 ctp.addRedrawRequestHandler(this);
141 ctp.addOutputParameterChangeHandler(this);
142 left.addChild(ctp);
143 }
144 else {
145 left.setVisible(false);
146 }
147
148 chart = createChartImg();
149 right.addChild(chart);
150 right.setOverflow(Overflow.HIDDEN);
151
152 tbarPanel = createChartToolbar(this);
153 vLayout.addMember(tbarPanel);
154 vLayout.addMember(hLayout);
155
156 setPane(vLayout);
157
158 right.addResizedHandler(this);
159 }
160
161
162 public ChartThemePanel createThemePanel(
163 OutputMode mode, CollectionView view
164 ) {
137 // Output "cross_section" needs slightly modified ThemePanel 165 // Output "cross_section" needs slightly modified ThemePanel
138 // (with action buttons). 166 // (with action buttons).
139 if (mode.getName().equals("cross_section")) { 167 if (mode.getName().equals("cross_section")) {
140 ctp = new CrossSectionChartThemePanel(mode, this.view); 168 return new CrossSectionChartThemePanel(mode, view);
141 } 169 }
142 else { 170 else {
143 ctp = new ChartThemePanel(mode, this.view); 171 return new ChartThemePanel(mode, view);
144 } 172 }
145 173 }
146 ctp.addRedrawRequestHandler(this); 174
147 ctp.addOutputParameterChangeHandler(this); 175
148 176 public ChartToolbar createChartToolbar(ChartOutputTab tab) {
149 chart = createChartImg(); 177 return new ChartToolbar(tab);
150 right.addChild(chart);
151 right.setOverflow(Overflow.HIDDEN);
152 left.addChild(ctp);
153
154 tbarPanel = new ChartToolbar(this);
155 vLayout.addMember(tbarPanel);
156 vLayout.addMember(hLayout);
157
158 setPane(vLayout);
159
160 right.addResizedHandler(this);
161 } 178 }
162 179
163 180
164 public void toggleThemePanel() { 181 public void toggleThemePanel() {
165 this.left.setVisible(!left.isVisible()); 182 this.left.setVisible(!left.isVisible());

http://dive4elements.wald.intevation.org