comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/fixation/FixationPanel.java @ 2922:71db63f67d31

FixA: Do not throw layout away if only the km chart needs reloading. flys-client/trunk@4777 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 25 Jun 2012 13:50:22 +0000
parents be99bf1aa59b
children 43e0f6d96206
comparison
equal deleted inserted replaced
2921:96d02c6f44a2 2922:71db63f67d31
233 FixAnalysisArtifact art = (FixAnalysisArtifact) this.artifact; 233 FixAnalysisArtifact art = (FixAnalysisArtifact) this.artifact;
234 if (km < 0) { 234 if (km < 0) {
235 km = 0; 235 km = 0;
236 } 236 }
237 art.getFilter().setCurrentKm(km); 237 art.getFilter().setCurrentKm(km);
238 if (chartContainer.hasMember(chartImg)) {
239 chartContainer.removeMember(chartImg);
240 }
241 238
242 int hWidth = helperContainer.getWidth() - 12; 239 int hWidth = helperContainer.getWidth() - 12;
243 int hHeight = helperContainer.getHeight() - 62; 240 int hHeight = helperContainer.getHeight() - 62;
244 241
245 if ((int)(hHeight *4/3) < hWidth) { 242 if ((int)(hHeight *4f/3) < hWidth) {
246 hWidth = (int)hHeight * 4/3; 243 hWidth = (int)(hHeight * 4f/3);
247 } 244 }
248 else { 245 else {
249 hHeight = (int)hWidth *3/4; 246 hHeight = (int)(hWidth *3f/4);
250 } 247 }
251 248
252 String imgUrl = GWT.getModuleBaseURL(); 249 String imgUrl = GWT.getModuleBaseURL();
253 imgUrl += "fixings-km-chart"; 250 imgUrl += "fixings-km-chart";
254 imgUrl += "?locale=" + locale; 251 imgUrl += "?locale=" + locale;
255 imgUrl += "&filter=" + art.getFilter().getChartFilter(hWidth, hHeight); 252 imgUrl += "&filter=" + art.getFilter().getChartFilter(hWidth, hHeight);
256 253
257 chartImg = new Img(imgUrl, hWidth, hHeight); 254 if (chartContainer.hasMember(chartImg)) {
258 chartContainer.addMember(chartImg); 255 chartImg.setWidth(hWidth);
259 256 chartImg.setHeight(hHeight);
257 chartImg.setSrc(imgUrl);
258 }
259 else {
260 chartImg = new Img(imgUrl, hWidth, hHeight);
261 chartContainer.addMember(chartImg);
262 }
260 } 263 }
261 264
262 265
263 protected void updateChartTabLow() { 266 protected void updateChartTabLow() {
264 FixAnalysisArtifact art = (FixAnalysisArtifact) this.artifact; 267 FixAnalysisArtifact art = (FixAnalysisArtifact) this.artifact;

http://dive4elements.wald.intevation.org